Skip to main content

Full text of "CBM 8-Bit Magazine Index: Compute's Gazette Special Section"

See other formats


ULTIMATE UTILITIES! 


ULTIMATE GAMES! 
@ 


PLUS a 
e 
; 


spa 
Se ON! | 
: ae ORNS 


Theda 


ena 7 


71486902193) "3 


64/128 VIEW 


Gazette needs 64 and 128 programs every month. 
If you are a programmer, here are 
some tips that can help you make a sale. 


Tom Netsel 


azette wants to buy 
your 64 and 128 pro- 
grams. Sell just one pro- 
gram, and you can eas- 
ily recoup the cost of your 
entire computer system. 
We rely on our readers 
for the programs we need 
each month to fill Gazette 
and Gazette Disk. Here are 
some tips on what we want 
and ways to make it easier 
for you to make a sale. 
Send your program and 
documentation on a disk. 
Save each twice, in case 
one gets damaged. Send a 
printout of your documenta- 
tion and a short cover letter 
explaining what your pro- 
gram does and how to run 
it. Enclose a daytime tele- 
phone number. Don't send 
a printout of your program 
listing. Send postage if you 
want your material returned. 
To increase your chances 
of making a sale, do all you 
can to make it easy for us to 
use and understand your pro- 
gram. I've rejected pro- 
grams because authors 
have made my job tougher. 
Here’s what we like to 
see in a submission. First of 
all, use the correct address. 
Don't delay things by writing 
to a post office box number 
we haven't used in years. 
Send programs to Gazette 
Submissions Reviewer, COM- 
PUTE, 324 West Wendover 
Avenue, Suite 200, Greens- 
boro, North Carolina 27408. 
Deadlines, interruptions, 
and weak coffee can put 
me in a bad mood at submis- 
sion meetings. Imagine that 
I've a stack of programs to 
get through, and I’ve just 
opened yours. You've got 
60 seconds to impress me. 
You'll be off to a good 
start with that note that ex- 
plains what your program 


does and how to run it. If 
there are numerous files, 
backups, and demos on 
your disk, | can get very an- 
noyed deciphering cryptic 
filenames, trying to decide 
which file to load first. 

If we've had your pack- 
age open for more than a 
minute and we still don’t 
know what it’s supposed to 
do, we'll do one of two 
things. We'll either reject the 
program outright or toss it 
back in the pile until next 
month. In the latter case, we 
don’t totally reject it, but 
we're not jumping to buy it ei- 
ther. This bumping process 
can go on for months. 

With your letter, send a 
printout of your documenta- 
tion. Here's where you can re- 
ally boost your chances for 
a sale. Write in the style we 
use in the magazine! Ex- 
plain what your program 
does, why it might be useful 
or entertaining, and whether 
it's in BASIC or machine lan- 
guage. Then explain how to 
use the program. Many au- 
thors fail to do this. 

It's very important that 
you send documentation on 
disk as well as paper. Save 
it as a PETSCII, ASCII, or 
SpeedScript-compatible 
file. DO NOT USE GEOS! | 
load your documentation 
into my 128, edit it, convert 
it to ASCII, and upload it to 
an IBM for additional editing 
and typesetting. Retyping 
your documentation wastes 
time. If | have a program 
whose instructions need mi- 
nor editing and one that re- 
quires hours of work, guess 
which one 1'll buy? ] 

Finally, tell us about your- 
self: your occupation, age, 
hobbies, and so on. We like 
to publish a little information 
about our authors. a 


GAZETTE 


64/128 VIEW 


If you send a game or utility to Gazette, follow 
these tips to boost your chances for a sale. 
By Tom Netsel. 


FEEDBACK 


Questions and comments from our readers. 


RELATIVELY SIMPLE 


Many programmers shy away from using 
relative files, but let's take another look 
at these black sheep of the file family. 
By Jayson Johnson. 


REVIEWS 
Tie Break, Calc II, and Bad Blood. 


BEGINNER BASIC 


Turn keyboard characters into movable sprites. 
By Larry Cotton. 


MACHINE LANGUAGE 


Use a rotating buffer to determine a program's 
starting address and more. 
By Jim Butterfield. 


WORLD VIEW 


Czechoslovakia loves its Commies, but 
politics has nothing to do with it. 
By Emil Heyrovsky. 


GEOS G-22 


GEOS graphics require a good management system. 
By Steve Vander Ark. 


PROGRAMMER’S PAGE G-24 


Here's a handy list of POKEs, WAITs, and SYS calls. 
By Randy Thompson. 


G-1 


G-2 


G-6 


G-18 


G-20 


G-21 


PROGRAMS 

File Logger G-25 

Demo Maker G-26 

F/X Plot 128 G-30 

Sprint Ill G-33 

Pad Design G-38 
Les eri 


JUNE 1992 COMPUTE 


GA 


G2 


Questions 

and answers about 
amortization 
tables, genealogy 
programs 

for the 64/128, 
and more 


COMPUTE JUNE 1992 


FEEDBACK 


Address Correction 

In “Commodore Clips” (Febru- 
ary/March 1992) we listed the 
wrong post office box number 
for Clip Art Cupboard. The 
correct address is P.O. 
Box 317774, Cincinnati, Ohio 
45231. We regret the error. 


Amortization Table 

| have been trying in vain to 
get hold of a program that 
will list amortization tables 
with an option of payments 
every two weeks. Can anyone 
help me? 

MARGIT DES LAURIERS 

SANDSPIT, BC 

CANADA 


In the May issue, Larry Cotton 
presented an amortization pro- 
gram in his ‘Beginner BASIC” 
column that displays pay- 
ments on a monthly or yearly 
basis. For payments other 
than monthly, however, you 
might try the following pro- 
gram. It asks for the amount 
borrowed and the number of 
payments per year. If you 
wish to make payments every 
two weeks, enter 26 at the sec- 
ond prompt. It will then re- 
quest the annual interest rate 
and the duration of the loan in 
years. 

The program will calculate 
the payment you must make 
for each period and then 
print a table showing the 
breakdown of interest and prin- 
cipal on each payment and 
the remaining balance. At the 
end of a year, it will print a to- 
tal of the principal and inter- 
est paid. The program will 
pause and wait for you to 
press any key before printing 
the next year's schedule of 
payments. 


RM 58 K$="PRESS ANY KEY 


{SPACE}TO CONTINUE 
" 


GR 166 PRINT" {CLR} 

SE 116 DEF FNA(X)=INT (X* 
108+.5) /108 

BJ 126 INPUT"AMOUNT BORR 
OWED" ;E 

MB 138 INPUT"NUMBER OF P 


/ aim 


146 


158 
166 
176 
186 
196 
195 


268 
210 


2268 
236 


246 
256 


266 


276 


280 
296 
306 


310 
326 


336 
346 


356 


366 


376 
386 
396 


406 


416 
426 


430 


446 
456 


466 
4768 
480 
496 
506 
510 


AYMENTS PER YEAR" 
iN 

; 

INPUT"ANNUAL INTE 
REST RATE"; I:I=1/ 
1668 
INPUT"DURATION IN 
YEARS"; D 
R=(I*E/N) /(1-1/(1 
/N+1) J (N*D)) 
PRINT 

PRINT"YOUR PERIOD 
IC PAYMENT WILL B 
E $";FNA(R) 
PRINTKS 

GET WS:IF WS=""TH 
EN 195 


PRINT 
AT=0:A2=G:EN=E:RT 
=8:IT=6:B=G:D1=N 


IF INT (D)>=1THEN2 
46 

B=Bt1l 

FORB=1TO INT (D) 
PRINT CHRS$(147)" 
{DOWN} AMORTIZATIO 
N SCHEDULE"; TAB (2 
5);" YEAR #";B 
PRINT: PRINT" #"TA 
B(5)"INTEREST"TAB 
(17) "PRINCIPAL"; 
PRINT TAB (31) "BAL 
ANCE": PRINT 


FORB1=1T0D1 
IV=FNA (EN) *I/N 
RT=RT+1:A=R-IV:AT 
=AT+A:EN=E-~AT 
IFRT<>N*DTHEN336 
R=R+EN: A=A+EN: ATS 
AT+EN:EN=0 
I2=12+IV:IT=IT+IV 
2:A2=A2+A 

A2=INT (A2*106+.5) 
/168 
PRINTB1;TAB (4) ;FN 
A(IV) ;TAB(16) ;FNA 
(A); 

PRINT TAB (3G) ;ENA 
(EN) 

NEXT 

IF RT<>N*DTHEN4GG 
PRINT: PRINT" LAST 
{SPACE} PAYMENT"; F 
NA(R): PRINT 
PRINT: PRINT"FOR T 
HE CURRENT YEAR Y 
OU PAID" 
PRINT"S$";FNA (IT); 
"IN INTEREST " 
PRINT"AND S";FNA( 
A2);"IN PRINCIPAL 
" 


IF B=D OR B>D THE 
N 540 

PRINT: PRINTKS 
GET WS:IF WS=""TH 
EN 450 

PRINTCHRS (147) 
IT=G6:A2=6 

NEXT 

B=B-1 

IF D=BTHEN5S4@ 
D1=((D-INT (D))*12 


)/12*N 

B=Bt1 

GOTO 256 

PRINTKS 

GET WS:IF WS=""TH 
EN 550 

END 


CM 
RF 
GP 
ER 


526 
536 
546 
556 


EK 560 
Genealogy Programs 

| am looking for a family tree 
program for my 64. Can you 
help? 

FREDERICK J. CARLETON 

METAIRIE, LA 


We published “Climbing Your 
Family Tree" in the February 
1991 issue of COMPUTE in 
which the author described 
several programs available 
for the 64 that let users enter 
family data. You might want 
to contact the following com- 
panies about their genealogy 
programs. Here's a list of the 
ones mentioned in the article. 


Family—$34,95 

PFA 

8600 Old Spanish Tr., Ste. 79 
Tucson, AZ 85710 

(800) 366-1372 


PED C and FGS—$39.95 
BYTEWARE 

906 West 6th Ave. 
Monmouth, IL 61462 
(309) 734-7096 


Arbor-Aide—$34.95 
SOFTWARE SOLUTIONS 
7378 Zurawski Ct. 
Custer, WI 54423 

(715) 592-3594 


Family Roots—$225.00 
QUINSEPT 

PO. Box 216 
Lexington, MA 02173 
(800) 637-7668 


Keyboard Wanted 

The time has come for me to 
locate a new detached key- 
board for my 128D. Perhaps 
one of your readers may 
have one for sale. 


STEPHEN VAN EGMOND 
360 FRONT RD. 
LASALLE, ON 

CANADA NQJ 125 


Commodore-Ready Printer 
Jrom Star 
At An Incredible Price! 


°119% 


NX-1000C. 

enley neatetter quali 
eed draft at 144 cps, Featur 

papel Parking function and See 

iat panel Controls. Includes four built-in 

os Over 20 typestyles. This is the 
mmodore-ready version of the NX-1000, 


THE COMPUTER PRINTER 


You can just Plug it in and inti 
ce S start TER 
Additional interfaces or cables an eee OTHER STAR PRINTE S 
; Sug. Retail } 
NX-1000C Painter 730 Roo s222100 NX-1001 Multi-Font 90895 $139.95 
aia na SPECIAL! $119.93 NX-2420 Rainbow 451047 § 299, 
Dopon (NX-1000C) 75471” $5.95  NX-1020 Rainbow 179393 
on (NI 75471 f 0 I A51027 $179.95 
$8.95 LaserPrinter 4 A57934 $879.00 


Don‘t miss out on the lowest prices on 


the Amiga 500, plus a full line of 
Commodore and Amiga hardware, 


software, and accessories. 


Commodore 64 


Computer 


Only 
$139” 


Commodore 1541 Il 
Disk Drive 


Only 


: $169" 


IL. 


Call today to receive your FREE 
catalog with the greatest prices on the 
most popular hardware and software! 


P.O. Box 6578 

South Bend, IN 46660 
(219)259-7051 FAX (219)259-0300 
We gladly accept mail orders! 
Circle Reader Service Number 170 


Order Today! Call. 1-800-PROMPT-1 


Shipping, Handling, Insurance 
Order Amount Charge 


less than $19.99 $4.50 
$20.00-$39.99 $5.75 
$40.00-$74.99 $6.75 
$75.00-$99.99 $7.75 
$100.00-$149.99 $8.75 
$150.00-$299.99 $9.75 
$300.00-$499.00 $11.75 
$500.00-$699.99 $18.75 
$700.00-$999.99 $24.75 
$1000 & Over 2.5% of Order 


COMMODORE 64 and COMMODORE 128 are registered trademarks of Commodore Electronics, Ltd. AMIGA is a registered trademark of Commodore Amiga Inc., NOTE: Due to publishing 
lead-times, product prices and specifications are subject to change without notice. "APO, FPO, AK, HI, CN, VI, GU, and foreign orders are subject to additional shipping charges. 


Circle Reader Service Number 170 


G5W. 


G-4 


An update 

to a sports card 
collection 
program and tips 
about writing 
your own game 
programs 


COMPUTE JUNE 1992 


FEEDBACK 


Cursor SYS for 128 

SYS 52591 will turn on a cur- 
sor on the 128 in 80-column 
mode. But what is the SYS 
number to release the cursor? 


ROBERT NELLIST 
BROCKPORT, NY 


A SYS to address 52591 
($CD6F) will turn the cursor 
on in either 40- or 80-column 
display mode. To disable the 
cursor in either mode, enter 
SYS 52639 ($CD9F). 

If you do any programming 
in 64 mode, you might be in- 
terested in reading Randy 
Thompson's ‘Programmer's 
Page” this month. His column 
contains a handy reference ta- 
ble for 64 programmers that 
lists dozens of interesting and 
unusual SYS calls, POKEs, 
and WAIT commands. 

Most of these items were 
submitted by our readers. We 
encourage—and pay for—pro- 
gramming tips used on the 
“Programmer's Page." 


Sports Card Update 

| have just started collecting 
trading cards, so Kevin 
Davis's Sports Card Collector 
(November 1991) is a bless- 
ing. One thing that | felt was 
missing was an indication of 
when you had last updated 
the prices. So | added the fol- 
lowing to the program, and it 
works great. 


195 PRINT‘{12 SPACES}UPDATE: 
"DAS 

390 INPUT#8, YT:INPUT#8, DAS: 
INPUT#8,GC 

615 INPUT‘ k8>JENTER DATE: 
MO. DA. YR.{wht}”;DA$ 

1240 PRINT#8, YT:PRINT#8,DAS: 

PRINT#8,GC 


DOUGLAS JEFFERY 
TELKWA, BC 
CANADA 


Writing Games 

lam writing a game on my 64 
in BASIC. It's getting a little 
complicated, and I'm begin- 
ning to think that maybe | 


should be writing it in ma- 
chine language. How can | 
have a sound track running, 
sprites moving, and the com- 
puter awaiting input all at the 
same time? 


BRYAN PEASE 
LIVERPOOL, NY 


Computer games may seem 
to do many things at once, 
but they're actually doing on- 
ly one thing at a time. Comput- 
ers follow instructions sequen- 
tially. A system that does sev- 
eral different things at once is 
possible, but you would need 
more than one computer or 
microprocessor (each operat- 
ing sequentially). To give 
your program the appear- 
ance of simultaneous action, 
you need to plan. Separate 
the actions into subroutines. 
IF-THEN can decide whether 
or not you want to gosub to 
the appropriate routine. It 
might help to write, in plain 
English, the game conditions 
and their consequences. 

For example, if the fire but- 
ton is pressed, then launch 
missile and set missile flag. If 
the joystick moves, then 
move ship sprite. If one sec- 
ond has passed, then play an- 
other note of the song. If the 
missile flag is set, then move 
missile sprite again. Repeat 
the above loop. 

First, you check for the joy- 
stick button. If it's pressed, 
then gosub to the appropriate 
routine. If it's not, forget 
about launching the missile un- 
til the next time through the 
loop. Once you've launched 
the missile, you want it to con- 
tinue moving, which is the rea- 
son for the missile flag. Wheth- 
er or not the button was 
down, you next peek the joy- 
stick to see if the player 
wants to move and update 
the ship's position. Third, you 
check the jiffy clock by read- 
ing variable TI or TI$ to see 
how much time has gone by. 
If a second (or whatever time 


period you've chosen) has 
passed, play the next note of 
the song. 

Next, move the missile 
sprite if the flag is set, and go 
back. The program loops 
around, checking the joystick 
twice, checking the time, 
checking a variable, and tak- 
ing any necessary action. 

The computer works quick- 
ly, so individual actions seem 
to happen simultaneously. 

To convert the above out- 
line into a playable game, 
you'd need a few more subrou- 
tines. One would check the 
collision register in case the 
missile has hit something. An- 
other would erase the sprite 
and reset the flag as soon as 
the missile has reached the 
top of the screen. And, of 
course, you'd have to trans- 
late the outline into BASIC 
code. 

There's another technique 
that's even closer to simultane- 
ous action, but it requires 
from an intermediate to an ad- 
vanced knowledge of ma- 
chine language. Sixty times a 
second the computer stops 
what it's doing and takes 
some time to redraw the im- 
age on the screen. The main 
program is being constantly 
interrupted. Using a wedge, 
you can divert the interrupt to 
your own machine language 
program, which could play mu- 
sic, move sprites, or whatever 
you choose. Such interrupt- 
driven routines are sometimes 
difficult to implement, but 
they can be very effective. 


Do you have a question or 
problem? Have you discov- 
ered something that could 
help other 64/128 users? Do 
you have a comment about 
something you've read in Ga- 
zette? We want to hear from 
you. Send your questions and 
comments to Gazette Feed- 
back, 324 West Wendover Av- 
enue, Suite 200, Greensboro, 
North Carolina 27408. a 


RIO 800-782-9110 


COMPUTERS 


MON-SAT 8AM-6PM PACIFIC TIME 


ORDERS 
ONLY 


CUST SERVICE/TECH SUPPORT 
AUTOMATIC VOICE/FAX SWITCH 
702-454-7700 
TUE-SAT 1PM-5PM PACIFIC TIME 


VIDEOFOX 


The Tool For Creative Video Buffs 


Generate video titles, opening credits, window 
advertising, animation or other small trick movies 
WAIl of these exciting effects are are easy and fun for you to do with 
our new Videofox software 
@ Provides 18 special effects such as scrolling, combing, winshield 
wiper and spiral mixing 
@ Mix text, graphics and effecs to produce hundreds of combinations 
i Independent adjustment of foreground and background colors 
@ Page flipping in real time for perfect animation sequences 
@ seperate adjustment of brightnes levels for each 


ONLY $59.95 of the red - green - blue primary colors 


HANDYSCANNER 64 


The Worlds First Handscanner for the 64! 

@ Professional quality super high 400 dots per inch resolution ~ Reads the graphics from any printed document 

@ Converts any material to digitized graphics in seconds ~ B/W setting for crisp reprodution of high contrast line art 
@ Elaborate grey-tone scale digitizes color or black & white photos using 3 built in dithering settings 

Enlarge or reduce 300% to 33% ~ Graphic memory of 640 X 400 standard (640 X 800 with Pagefox module) 

@ Included software has all the standard functions of a good drawing program 


Saat | ONLY $299.95 
3 Easy To Use Editors For Perfect 


PA GEFOX Home Desktop Publishing 


GRAPHIC EDITOR ~ TEXT EDITOR ~ LAYOUT EDITOR 
@ Completely menu driven 

@ 100Kb storage enlargement module keeps entire page in memory 

@ Uses proportional mouse or joystick for total control over text, graphics or picture 


ONLY $139.95 St 


VIDEO 
DIGITIZER 


itize black and white or color pictures 

igitize any video source including VCR 

@ Digitize either 4, 7 or 13 level grey levels 

@ Menu controled picture brightnes 

@ Includes three independent software programs 
for total control and editing of digitized images: 
DIGISON ~ DIGIFOX ~ DIGIMULTI 

@ Free color filters included for digitizing color 
images from black and white cameras 


fener. fe 


— 
‘my rar mars | 


ACTION REPLAY V 6.0 


THE ULTIMATE UTILITY/BACKUP CARTRIDGE FOR THE C64/128 


Allows You To Freeze The Action Of Any Memory Resident Program And Make A Complete Backup To Disk 


= 


WARP 25 - The worlds fastest disk serial Turbo 

@ Typical backup will reload in under 5 seconds 

@ No special formats-save directly into Warp mode 

@ Warp Save/Load available straight from BASIC 

RAMLOADER - Loads most commercial originals 
25 times faster than normal! 

UNIQUE CODE CRACKER MONITOR - 

@ Full monitor features 


MORE UNIQUE FEATURES - Menu driven operation 
@ Simple operation: Just press a button at any point 

B® All backups reload WITHOUT cartridge at Warp speed 
@ Sprite killer: Make yourself invincible-disable collisions 
@ Freeze HiRez screen & save in Koala & Paddles format 
@ Print out any screen in 16 grey scales 

@ 100% compatible with ALL drives and computers 

@ Disk utilities: fast format, directory, list and many other 


@ See the code in its Frozen state not Reset state 


commands operated directly from function keys 


MIDI 64 -Only $49.99 


@ Full specification MIDI at a realistic price 

@ MIDI In - MIDI Oyt - MIDI Thru 

@ Works with Sampler and Adv. Music System 
MIDI CABLES (4 ft. prof. quality) -Only $*8.99 


FREE cables when you buy MIDI & ADV. MUSIC at same time 
DIGITAL SOUND SAMPLER 
Only - $89.99 


THE ADVANCED 


OCP ART STUDIO 
COMPREHENSIVE, USER FRIENDLY ART 
AND DESIGN SOFTWARE 


Only - $29.99 


ADV. MUSIC SYSTEM 


Powerful modular program for creating, editing, 
playing and printing out music 

@ Playback thru internal sound or external MIDI 
keyboard/synthesiser 

@ Print music in proper musical notation together 
with lyri ing PRINTER module 

@ Enter music a note at a time in written music 
format using the EDITOR or via on screen 
piano KEYBOARD emulator or via an 
externally connected MIDI keyboard 

@ Generate almost unlimited sounds with the 
flexible SYNTHESIZER module 

@ Linker joins files to form large compositions 


Only - $29.99 


MAKE THE MOST OF YOUR 
ACTION REPLAY 


GRAPHICS SUPPORT DISK 
B View screens in a slide show sequence 
i Add scrolling messages to your saved screens 
@ Contains full sprite editor 
B Explodes sections of saved screens to full size 


Only - $19.99 
SUPERCRUNCHER - onLy $9.99 


Turn your Action Replay into a super powerful 
program compactor. Reduce programs by up to 
50%! Further compact progrms already crunched 
by Action Replays compactor 


3310 BERWYCK STREET 
LAS VEGAS, NV 89121 


RIO COMPUTERS *336.09 shiori 


foreign orders call 
COMPUTER MODEL WITH ORDER: VISA/MC/Checks/Money Orders/C.O.D. Accepted: Please call for 
return authorization number or your package will be refused - returns may be sudject to a 20% restocking 
fee after 15 days: Prices subject to change without notice. 


/handiing in the continental U.S.: $8.00 - PR, AK, HI, FPO, APO: $11.00-Canada: Other = jaf 
or write for shipping charges: C.0.D. orders add $5.00 to above charges: SPECIFIY 800 782 91 1 0 


ai 


702-454-7700 


IN NEVADA 


Circle Reader Service Number 186 


— 


PROGRAMMERS 

OFTEN SHY AWAY FROM 
RELATIVE FILES, BUT 

MAYBE IT’S TIME TO TAKE 
ANOTHER LOOK 

AT THIS ALTERNATE METHOD 
OF DATA STORAGE. 


BY JAYSON JOHNSON 


Relative files are the black sheep of the 
data storage family. Programmers may try 
them once, have a few problems, and 


~ then give up on them. Then they spread 


the word to their friends to stay away 
from relative files. The reputation 
spreads. Unlike sequential files, relative 
files get no respect, but maybe it’s time for 
a change. 

Relative files do have good points and 
advantages. For one thing, they offer far 
more speed and efficiency than other meth- 
ods of data storage. Since they can ac- 
cess data without reading through every 
file that precedes the desired information, 
relative files offer almost random access. 
If you have a large sequential file, you 
must first load the entire file into the com- 
puter's memory for processing. Then to re- 
trieve data, you may have to read every 
file before you find the information you 
want. With sequential files, if you want a 


piece of information that's stored in record 
number 100, you'll have to plow through re- 
cords 1—99 first. 

Suppose you have a CD collection of 
500 titles and you want to catalogue it on 
index cards. If you put the titles in alpha- 
betical order and read them as a sequen- 
tial file reads data, you'd have to flip 
through the whole stack before you came 
to anything by ZZ Top or Pia Zadora. 

With relative files, you can go directly to 
the data you want and read only that da- 
ta. Just as with index cards, you can 
home in on the information you want with- 
out starting from the beginning and flipping 
sequentially through every file. 

Since a relative file program uses only 
enough memory to read desired data, very 
little computer memory is actually used at 
one time. A small program can access 
163K of information that could be stored 
on a single-sided disk. 


Follow the Rules 
Creating and using relative files is fairly 
easy, providing you follow a few simple 
tules. First, let's get some terminology 
straight. With relative files, information is 
stored in records, and each record con- 
tains various fields. In the following exam- 
ple, we'll create a mailing list. This whole 
list is our file. Each person on our list will 
be a record, and the various pieces of da- 
ta about each person will be our fields. 
For example, each record on our list 
will contain a person's first and last 
names, street address or post office box 
number, city, state, ZIP or postal code, 
and telephone number. These are the 
fields we'll set up for each record. We'll be- 
gin by calculating the total size of each re- 
cord. This is done by adding the number 
of characters in each field. With our mail- 
ing list, we'll estimate how many charac- 
ters each field should contain. 


Field# Field name Number of 
Characters 


1 Lastname 15 
2. Firstname 15 
3 Addressi 20 
4 Address2 20 
5 Address3. 20 
6 State 10 
7 Zip Code 09 
8 Phone # 12 
Total 121 


The record size for this file would be 
121. Since the PRINT# statement 
used with relative files adds a carriage 
return to the end of each string, you 
should add one extra character to 
each field. So make it 129. If you try to 
write 15 characters plus a CHR$(13) 
(carriage return) to a record set up for 
15, you'd get an ERROR 51, OVER- 
FLOW IN RECORD. 

DOS uses a single ASCII character 
to represent the record length, This 
means that the largest single record 
could be 254 characters. This is very im- 
portant to remember. If you want more 
information stored in each record, 
you'll have to split them in two. For ex- 
ample, a 500-character record could 
be split into two 250-character records. 
You could use odd and even numbers 
to identify each data pair. 

The largest number of records you 
can have is 65,535, but you'll never 
use this many because of space limi- 
tations on a floppy disk. A freshly for- 
matted disk should show 644 blocks 
free. Blocks, or sectors, are the areas 
on a disk that can hold up to 256 char- 
acters of information. DOS uses 2 of 
these characters, so that leaves 254 
bytes available for data. 

Relative files use side sectors as an 
index to keep track of which sectors 
contain data. Each side sector has 
room for 120 two-block pointers that let 
DOS quickly locate the various blocks 
assigned to the file. 

As many as six side sectors can be 
assigned to a file since each can deal 
with 120 disk sectors (not records) for 
a total of 720, more than the number of 
blocks on a disk. Filling a 664-block 
disk would use 6 blocks for side sec- 
tors, leaving 658 blocks for data. Each 
block can hold 254 characters, giving 
you 167,132 characters in the largest 
possible relative file. You can split this 
up any way that is convenient for your 
data. You could have 1671 records of 
100 characters each or 658 records of 
254 characters each. 


Create a File 

We have to create a file before records 
can be stored or read. This is done by 
opening a data channel with the de- 


G-8 COMPUTE JUNE 1992 


sired filename and record length. You 
should note that DOS won't let you cre- 
ate relative files with record lengths of 
42, 58, or 63. These numbers repre- 
sent ASCII values that have special 
meaning to DOS. The format for creat- 
ing a relative file is as follows. 


OPEN file#, device#, channel#, ‘‘file- 
name,L,” + CHR$(record length) 


Let's start writing a program and call 
our file MAILLIST. We previously count- 
ed the number of characters we'd 
need in each record and decided on 
129. Type in the following OPEN com- 
mand, but don’t run the program until 
we complete it. 


1000 REM OPEN MAILLIST FILE 
1005 OPEN 1,8,2,‘MAILLIST,L,”+CHR$(129) 


Remember not to run it yet. It's now pos- 
sible for us to put information into the 
file. In DOS, there's no command to 
check the number of records in a rel- 
ative file; however, it's possible to 
store this number manually within the 
first record. Let's do this by positioning 
the record pointer to the first record 
and storing the number 1. To do this, 
we must open the command channel. 


1010 OPEN 15,8,15 


The POSITION command for record 4, 
position 1 is 


1015 PRINT#15,“‘P”+ CHR$(2) + CHRS$(1) + 
CHR$(0) + CHR$(1) 


The P is our pointer, and it tells the 
drive to look for a certain record. In 
CHR&(2) above, 2 is the channel we 
opened when we created the file in 
line 1005 (OPEN1,8,2,). Next, put the 
number 1 into the record, because all 
we have now is one record in our file. 


1020 PRINT#1,1 


Print to the file number we assigned 
when we opened the file. (Remember 
OPEN 1,8,2.) Then, close the file and 
the command channel, and the file is 
ready to use. 


1030 CLOSE1:CLOSE15 


Run the program now, and a file 
called “MAILLIST” will be created and 
placed in the disk’s directory. 


Writing and Reading 

To read from or write to any record in 
our file, we open two channels, the 
DOS command channel and a file chan- 
nel. Now we can position the record 
pointer to any record and field in the 


file with the DOS POSITION command. 


PRINT#15,‘‘P” + CHRS$(channel number) + 
CHRS$(rec# Io) + CHRS(rec# hi) + 
CHRS(position within record) 


Notice that in the above line there are 
two characters that represent the re- 
cord number (rec# lo and rec# hi). The 
formula for calculating these two num- 
bers is as follows. 


RECORD # = REC HI * 256 + REC LO 


The record number can also be deter- 
mined in other ways. 


REC HI = INT(RECORD #/256) 
REC LO = RECORD # - REC HI*256 


Translated, the command sequence 
would be as follows. (You don't have to 


_ TIPS ON USING 

RELATIVE | FILES — 

Relative files are good ways to store da- 
ta for quick and easy access, but many 
_programmers avoid using them. Here 

are a few things to remember | to avoid 

problems. 
als Aways iniialze the disk drive at the be- 
ginning of your program to reset all 

__ drive channels. 

2. Always set the file pointer to the first 
byte in a record..The last parameter in 

the P command should be CHR$(1). 

3. Never write an empty string to the 
disk. This will cause the disk drive to 
lock in a continuous loop. 

4. Never leave a file open after entering 
or editing data. Be sure to open, read/ 
write, and close the file in the same 
ceominan sequence. 


If you attempt to create a file that's too 
large for the space remaining on your 
disk, you'll get ERROR 52, FILE TOO 
LARGE. If you plan to store a lot of data, 
it's a good idea to devote a whole disk 
to a relative file. 

_ Here's a short BASIC program to deter- 
mine the maximum number of records you 
can have on a disk. To use the program, 
you must know how many free blocks re- 
main on your disk and the total number of 
characters allotted for each record. 


10 INPUTNUMBER OF FREE BLOCKS ON 
DISK”;FB 

20 INPUTTOTAL CHARACTERS IN 

~ RECORD” :RL: IF RL<t OR RL>254 THEN 
20 

30 IF RL=42 OR RL=58 OR RL=63 THEN 
-PRINTDO NOT USE”;RL; 
“CHARACTERS”: GOTO 20 

40 SS%=((FB/120)+.99): BA=FB-SS% 

50 RP=(INT(BA*254/RL): IF RP465536 THEN 
RP=65535 

60 PRINT“ THERE'S SPACE 
FOR” RP;‘RECORDS” 


= =I] 


INTRODUCING 


COMPUTE 


COMPUTE ofA NET 


@ About COMPUTE/NET 
@ Product Ordering 

l™ Feedback Board 

@ Coming Events 
® Monthly Contest 


NET 


Welcome to the grand opening of 
COMPUTE/NET. A wealth of 
information awaits you. Back issues 
of COMPUTE, hard-to-find computer 
books, super software, dazzling 
pictures, challenging games, prizes, 
a complete bulletin board, and 
much more are here. You can even 
talk to the editors and authors of the 
magazine. Lots of surprises are 
planned, so keep your eyes on us. 


FIND US ON Q-LINK 


FREE 


Q-LINK STARTER KIT. 


FREE TIME. ORDER TODAY! 


Just call our toll-free number or 
return the coupon, and we'll send 
you the Q-Link Starter Kit and 
software free, waive your first 
month's membership fee, and credit 
you with one hour of "Plus" time to 
try the service. Your $9.95 monthly 
fee gives you unlimited access to 
all of our "Basic" services online, 
including a searchable encyclope- 
dia, AND one free*hour of "Plus" 
services. After your free hour, 
you'll pay only $4.80/hour—just 8 
cents per minute-for additional use 
of the service. 


Q-Link is a registered service mark of 
Quantum Computer Services, Inc. 


*Long-distance charges may apply. 
Surcharges apply if you are a resident of 
Alaska, Hawaii, or Canada. Allow four to 
six weeks for delivery. 


Call 1-800-782-2278, Ext. 2414 today 


YES! Send me my FREE Q-Link software, waive my 
first month's membership fee, and credit me with one 
FREE® hour of Plus time to explore the service and try 
COMPUTE/NET. 


Nance =" eee 
Address. 
City 

Home Phone 


MAIL TO 


Q-Link 


8619 Westwood Center Drive 
Vienna, Virginia 22182-9897 


Use of Q-Link requires a VISA, 
MasterCard, or checking account. 


enter NEW before typing this next sec- 
tion. It and the remainder of the code 
are meant to be added to the previous 
program lines.) 


10 OPEN15,8,15 

15 OPEN1,8,2,"“MAILLIST”: REM WE ARE 
OPENING, NOT CREATING THE FILE 

40 R = 1: P = 1: REM RECORD NUMBER 1 
POSITION 1 

45 GOSUB 500 

90 CLOSE1: CLOSE15: END 

500 REM POSITION RECORD POINTER 

510 RC = R + 1: REM ADD 1 TO RECORD 
(REC1 IS ALREADY USED TO HOLD FILE 
LENGTH) 

520 RH% = RC/256: RL = RC-RH% * 256: 
REM TWO-BYTE ADDRESS; RH% IS AN 
INTEGER 

530 PRINT#15,‘P” + CHRS(2) + CHRS(RL) + 
CHRS(RH%) + CHRS(P) 

540 RETURN 

999 END 


Don't run the program yet. 


Record Contents 

Each record is actually a string of infor- 
mation in itself. To read each field sep- 
arately, we must calculate where it be- 
gins within the record. Here are the 
record sizes we established earlier. We 
can use these figures to determine 


where to look for each field. 


Last name 1-15 
First name 16-30 
Address 31-50 
Address2 51-70 
Address3 71-90 
State 91-100 
Zip Code 101-109 
Phone # 110-121 


Now let's make a list of pointers for 
each field. 


5000 DATA 1, LNAME, 16, FNAME, 31, AD1, 
51, AD2, 71, AD3, 91, STATE, 101, ZIP, 
110, PHNO 


As you can see, this translates into 
Last name at position 1, First name at 
position 16, Address1 at position 31, 
and so on. 


Writing Data 

Let's enter some information into a sam- 
ple record. As we do, we'll write over 
line 45 in the earlier subroutine. 


35 REM STORE RECORD 
45 FS(1)=""JOHN": F§(2)="DOE” 

50 F$(3)=""15 HOLLYWOOD AVENUE” 
55 F§(4)=""{SPACE}” 

60 F$(5)=""HOLLYWOOD” 


65 FS(6)="CALIF.” 

70 FS(7)="90135" 

75 FS(8)="555-964-6652” 

80 RESTORE: REM RESET DATA POINTER 

85 FORLP=1T08: READP,X$: GOSUB500: 
PRINT#1, FS(LP): NEXTLP 


When you have this final block of 
code entered, you may run the pro- 
gram typed in so far. You may also 
want to save it to disk. 


Reading Data 

Reading information is just the oppo- 
site. You set the pointer and use IN- 
PUT# to read the information instead of 
PRINT#, which is used to write it. 


20 GOTO100 

100 REM READ RECORD 

110 R=1: REM RECORD 1 

115 RESTORE: RESET BASIC DATA POINTER 

120 FORLP=1T08: READP,X$: GOSUB500: 
INPUT#1,F$(LP): NEXTLP 

125 CLOSE1: CLOSE15 

130 PRINT“LAST NAME: ”;FS(1) 

135 PRINT“FIRST NAME: ”;FS(2) 

140 PRINT“ADDRESS: ” 

145 PRINTFS(3) 

150 PRINTFS(4) 

155 PRINTFS(5);", ”;F$(6),F$(7) 

160 PRINT PHONE#: ”;FS(8) 

175 END a) 


“You're not quite as smart as you thought you were, eh? I've unplugged you!” 


COMPUTE JUNE 1992 


GAZETTE 
D\SK L/BRARY 


VALUE-PACKED SOFTWARE 
AT AFFORDABLE PRICES 


All Gazette disks are menu-driven for ease of use—and they feature complete 
documentation. Just load and you're ready to go! 


SpeedScript $11.95 
COMPUTE Publications’ most popular program 
ever. Powerful word processing package includes 
SpeedScript for the 64, SpeedScript 128, spelling 
checkers for both 64 and 128 versions, plus an 
additional dozen support programs, including 
mail-merge and word-count utilities. 


Gazette Index $7.95 
Every article and department from Gazette—July 
1983 through December 1989 issues—is indexed: 
features, games, reviews, programming, ‘Bug- 
Swatter,”’ “Feedback,” and the other columns. 
Disk features pull-down menus, help screens, 
superfast searching/sorting capabilities, and 
much more. 


Best Gazette Games $9.95 
Best dozen arcade and strategy games ever 
published in Gazette all on one disk. All games for 
Commodore 64, Titles: Crossroads II: Pandemo- 
nium, Basketball Sam & Ed, Delta War, Heat 
Seeker, Omicron, Powerball, Q-Bird, Trap, Arcade 
Volleyball, Mosaic, Power Poker, and Scorpion I. 


‘The GEOS Collection 


Gazette’s Power Tools $9.95 
Fourteen of the most important utilities for the 

64 ever published in Gazette. For serious users. 
Titles: MetaBASIC, Disk Rapid Transit, Mob Maker, 
Ultrafont+, Quick!, Disk Editor, Basically Music, 
PrintScreen, 1526 PrintScreen, Fast Assembler, 
Smart Disassembler, Comparator, Sprint Il, and 
Turbo Format. 


$11.95 
Gazette’s best 13 programs for GEOS and GEOS 
128 users. Selection includes utilities, applications, 
and games. Titles: Super Printer Driver, Skeet, File 
Saver, Help Pad, Word Count, Directory Printer, 
Quick Clock, SlideShow, File Retriever, Screen 
Dumper, Font Grabber, GeoPuzzle, and 
GeoConverter. 


128 Classics $11.95 
Thirteen of Gazette’s best 128 programs, including 
utilities, games, and applications. Titles: 
MetaBASIC 128, RAMDisk 128, 80-Column Disk 
Sector Editor, MultiSort, Block Out, Miami Ice, 

The Animals’ Show, Cribbage, XPressCard, Sound 
Designer, ee Slide Show, Math Graphics, and 
3-D BarGra; 


* Residents of North Carolina and New York add appropriat 


All 6 DISKS FOR ONLY $49.95! 


je sales tax. Canadian orders, add 7% goods and services tax. 


A $13.00 SAVINGS! 


Name 

Address 

City State ZIP 

Amount Method of 

enclosed § payment Check or Money Order 


(for orders over $20) 
324 W. Wendover Ave., Ste. 200 
Greensboro, NC 27408 


Credit card no. 
Signature (required) 
Daytime phone number 


Mail to Gazette Disks 


Exp, date 


** For delivery outside the U.S. or Canada, add $1 for surface mail or $3 for airmail. All orders must be in U.S. funds drawn on a U.S. bank. 


§ SPECIAL OFFER! 

} All prices include shipping & handling. 

I SpeedScript O $11.95 
I Gazette Index O $7.95 
rT Best Gazette Games O $ 9.95 
| Gazette’s Power Tools O $ 9.95 
I The GEOS Collection O $11.95 
i 128 Classics O $11.95 
§ Special 6-Disk Offer O $49.95 
i Subtotal 

} Tax’ 

i Outside U.S. or Canada** 

| Total 

| 

| 

L 


i 
i 
i 
i 
i 
i 
i 
O VISA or MasterCard : 
i 
i 
i 
i 
i 
i 
i 
i 


REVIEWS 


TIE BREAK 


Tennis anyone? You don't 
have to be a top seed tennis 
professional at Wimbledon 
to enjoy playing DigiTek Soft- 
ware's Tie Break. This compu- 
terized tennis game is for ten- 
nis lovers of all levels. 

Tie Break offers three 
modes of play: world tourna- 
ment, tournament, and train- 
ing. World tournament is for 
those who want a real chal- 
lenge. Here, you select up to 
16 players (human or comput- 
er), and you must defeat all 
of them to win the champion- 
ship. You then select the 
world tournament that you 
want to enter. These vary in 
level of difficulty and include 
Wimbledon, the French 
Open, the Masters, the U.S. 
Open, the Davis Cup, and 
the Australian Open. For ex- 
tra realism, each player is as- 
signed a racket of a certain 
tension and weight. 

Perhaps you don't feel 
ready for world tournament 
play just yet. If you just want 
to compete against a few of 
your friends, select tourna- 
ment play. Once again, 
each player is assigned rack- 
et weight and tension. You al- 
so select the surface type 
and color that you want to 
play on. Court types vary in 
difficulty since the ball may 
move faster or bounce differ- 
ently on certain surfaces. For 
example, the ball will move 
faster on an asphalt or a PVC 
court than it will on clay. 

Let's say that you haven't 
played for a while and are a 
little rusty. If you feel like prac- 
ticing either before entering 
a world tournament or play- 
ing against your best friend 
who happens to be a tennis 
pro, then select training. 
Here, you can practice with 
a variety of computer players 
of varying skill levels. 

If your friend wants to prac- 
tice as well, you both can 


G-12 COMPUTE JUNE 1992 


play against each other or 
play doubles with two com- 
puter players. (To play 
against a friend, one person 
must use the joystick, and 
the other must use the 64's 
arrow keys and space bar to 
control the onscreen play- 
ers.) This training mode also 
will let you experiment with dif- 


Tie Break is easy to learn. 
In no time, you'll have a rack- 
et in your hand, be ready to 
compete in a world tourna- 
ment, or be ready to play 
against the computer in the 
training mode. The level of dif- 
ficulty depends on such fac- 
tors as the number of players 
you must beat in a tourna- 


This player on a clay court has just hit a high lob to his singles 
opponent in Tie Break, DigiTek's new tennis game. 


ferent rackets and surfaces. 
Being able to practice with 
other players is a nice fea- 
ture of this game, since 
some of the other computer- 
ized tennis games let you 
practice only by hitting balls 
tossed by a ball machine. 
No matter what mode you 
select, you don't have to wor- 
ry about moving your player 
to the appropriate court po- 
sition to hit the ball. Tie 
Break automatically posi- 
tions the player for return 
shots. You simply decide 
how you're going to com- 
plete your return shot. Some 
of the options are volley, lob, 
slice, topspin, and smash. 
The computer will decide if 
your shot will be forehand or 
backhand. You control your 
shot’'s speed, direction, 
type, and length. It's also pos- 
sible to pause during the ac- 
tion or slow the game down. 


ment, the tension and 
weight of your racket, the op- 
ponent you select, and the 
court surface. This game's 
challenging to play, but it 
would be even more challeng- 
ing if there were an option to 
position your player yourself 
for return shots as opposed 
to having the computer do it 
for you. 

The manual provides you 
with enough information to 
get you started quickly. All 
types of shots are explained 
in enough detail so that you'll 
soon learn how to perform 
each one. There are even dia- 
grams to show you in more 
detail exactly how to hit cer- 
tain shots. The manual also 
includes useful information 
on how to use trick shots to 
defeat an opponent. 

Tie Break's graphics and 
sound effects are great on 
the 64. You watch the 


games as though you were 
looking down from above. 
You see the ball, players, 
court, and net in a three-di- 
mensional view. You can 
hear the sound each time 
someone hits the ball or the 
ball bounces off the court. 
Tie Break lets you know vis- 
ually when the ball hits the 
net or is out of bounds. You 
can see just what type of 
shots the players are taking, 
and the scores appear on 
the screen after each point is 
scored. 

Overall, Tie Break is fun 
and challenging, and it'll 
give you hours of entertain- 
ment. So if tennis is your rack- 
et, | think you'll love playing 
this game, especially if the 
weather is too nasty to go out- 
side on the courts. Bring the 
true-to-life action and excite- 
ment of tennis to your 64 and 
give this game your best 
shot. See you at Wimbledon! 
CHRIS SAUCIER 


Commodore 64 and 128—$29.95 


DIGITEK SOFTWARE 
1916 Twisting Ln. 

Wesley Chapel, FL 33543. 
(813) 973-7733 


Circle Reader Service Number 341 


CALC II 


Years ago, | typed in a 
spreadsheet called Speed- 
Calc that | saw in Gazette. 
Since it has always loaded 
quickly, has been easy to 
use, and has provided cor- 
rect answers with its calcula- 
tions, | couldn't see any rea- 
son for switching to another 
spreadsheet. That was be- 
fore | tried Calc II from 
Pankhurst Programming. 

I'll have to admit that, at 
first glance, | wasn’t im- 
pressed. | mean—a spread- 
sheet is a spreadsheet is a 
spreadsheet. They're made 
up of letters along the left 
side of the screen that iden- 
tify rows and numbers run- 


PUMP UP 


YOUR PRODUCTIVITY! 


Harness the potential of your, The Gazette Graphics 
64 and 128 with these ae 


Do it all with Commodore 


graphics! 
powertul programs. Here's what's on it 
Get more work out of your 64 and 128 eee ee 
with these two new disk products from 128 Graphics Compactor, 


64 Animator, VDC Graphics, 
Dissolve 128, Super Slideshow, 
128 Animator, 1526 PrintScreen, 
Supratechnic, Medium-Resolution 
Graphics, Screen Maker, GAS!64— 
Special Edition, GAS!128—Special 


ORDER 
THEM 
TODAY! 


COMPUTE's Gazette — the 1992 
Best of Gazette Utilities, and 

the Gazette Graphics Grab 
Bag! 

The 1992 Best of 
Gazette Utilities 

Seize control of your operating 
system and your world! 


Here's what's on it-MetaBASIC 64, 
MetaBASIC 128, Quick, Sprint Il, 
Ultrafont+, RAMDisk 64, RAMDisk 128, 
BASSEM, SciCalc 64, List Formatter, 
MegaSqueeze. 


Extend Your Computer Power With This Powerful Software! 


IY,’ © eee “check or Money Order __ MasterCard __VISA ral 

| | want to pump up my productivity! Please send me the 3 | 

| @ disks checked below at $11.95 each. Credit Card No. Exp. Date | 

4 Signature | 

| __The 1992 Best of Gazette Utilities (Required) | 

| ___ The Gazette Graphics Grab Bag Daytime Telephone No. | 

—— Subtotal Name | 

___ Sales Tax (Residents of NC and NY please add appropriate sales tax for your | 

| ~ area. Canadian orders, add 7% goods and services tax.) Address | 

| ___ Shipping and Handling ($2.00 U.S. and Canada, $3.00 surface mail, $5.00 City | 

airmail per disk. 

! Ree State/Province ZIP/Postal Code | 

| __ Total Enclosed 

Mail this coupon to COMPUTE's 1991 Utilities, 324 West Wendover Ave., Ste. 200, I 
| 

L MasterCard and VISA accepted on orders with subtotal over $20. Greensboro, NC 27408. | 


REVIEWS 


ning across the top that iden- 
tify columns. The intersec- 
tion where a row and column 
meet is called a cell, and 
Calc Il has plenty of those. In 
fact, it has 240 rows and 240 
columns. A 64 doesn't have 
enough memory to use that 
many cells, but it does have 
room for about 20K of data. 
The actual number of free 
bytes remaining is displayed 
at the top of the Calc Il 
screen. 

I'm going to assume that 
everyone knows what a 
spreadsheet is and jump 
right into Calc Il’s strong 
points and improvements 
over its earlier version. One 
feature that's almost worth 
the price alone is Calc II's abil- 
ity to split the screen into 
two, three, or four windows. 
This lets you see one part of 
the sheet while working in an- 
other section. 

Many times I’ve been en- 
tering data in a budget with 
dates running across the top 
of the page and with income 
and expense categories run- 
ning down the left. Things 
are fine as long as all the in- 
formation is on one screen. 
By the time you've entered 
enough data to scroll across 
and down the page, howev- 
er, you can no longer see the 
dates and the categories. Af- 
ter a while, you have to 
scroll back to the beginning 
to make sure you're entering 
data in the correct cells. 

With Calc Il you don't 
have this problem. You can 
open a couple of windows, 
lock the categories and 
dates in place, and then 
move anywhere on the 
sheet and still be sure you're 
not entering November's elec- 
tic bill in the cell reserved for 
December's rent payment. 
You can divide the screen in- 
to any size windows you like. 

Printing can also be a prob- 
em if your spreadsheet is 
arger than your printer can 
G14 COMPUTE JUNE 1992 


handle. Calc || automatically 
splits at the end of a page, 
printing the rightmost sec- 
tions on later pages. Other 
spreadsheets may wrap and 
print on the next line, destroy- 
ing the row and column or- 
der. You can print just a por- 
tion of the sheet if you don't 
need all of it. You can also 
use embedded printer 
codes in Calc II to utilize 
your printer's compressed 
print modes. 

Once you have data en- 
tered, you can manipulate it 
with Calc II's sorting routine. 
You can sort in ascending or 
descending order by row or 
column. This is the only area 
where | experienced any dif- 
ficulty. | entered a group of 
names running down the 
page in acolumn. When | de- 
fined this block of data and 
asked the program to sort 
the column in ascending or- 
der, nothing happened. Af- 
ter several unsuccessful at- 
tempts, | asked it to sort the 
row, and then it worked. The 
same held true with data 
across the page. | call that a 
row, but the sort routine ap- 
parently considers that a col- 
umn. Numbers sort with no 
problem, but text sorts ac- 
cording to word length un- 
less cells are left-justified. 

Data in cells can be justi- 
fied left, right, or center, de- 
pending on your preference. 
Columns can be adjusted 
globally or individually to fit 
data of any width, from 3 to 
38 characters. Other options 
include number of decimal 
places, auto or manual cal- 
culate, tape or disk, device 
number for printing, and 
screen and text colors. You 
can make these changes 
manually after a spread- 
sheet loads, but Calc II pro- 
vides a separate program 
that lets you customize the 
program to fit your preferenc- 
es. Then, anytime you run 
Calc ll, it'll default to your cus- 


tomized choices. 

Another program that 
comes with Calc II is amerg- 
er program. Use it to com- 
bine different spreadsheet 
templates onto one larger 
spreadsheet. The resulting 
file can be a merger of any 
number of previously saved 
templates. Text and formulas 
must use different cells, how- 
ever, or the second spread- 
sheet will overwrite those 
cells already in memory. 

Speaking of templates, 
Calc II provides about 40 of 
them that are ready to load 
and run. Some of them help 
you calculate break-even 
points, business budgets, de- 
preciation, loans, mortgag- 
es, standard deviations, and 
future worth of investments. 
Others will help balance 
your checkbook, keep a 
grade book, write sales 
slips, and figure factorials. 
One will even take room 
measurements and calcu- 
late how much wallpaper, 
paint, or carpeting you'll 
need for the job. 

Several of the templates 
have borders and lines to set 
off data. In the past, | had to 
be content with a series of 
equal signs or dashes to cre- 
ate such effects. With Calc 
Il, however, it’s possible to 
use many of the Commodore 
keyboard graphics to create 
design elements that make 
your spreadsheet easier to 
read and more appealing to 
the eye. 

Calc II treats mathemati- 
cal calculations in the same 
fashion as Commodore BA- 
SIC, so you shouldn't have 
any problems entering your 
own formulas. It even ac- 
cepts the Boolean operators 
And, Or, and Not. 

Calc Il also has a number 
of powerful built-in functions 
that can make your calculat- 
ing chores easier. In addition 
to the usual Sums, Square 
Roots, Tangents, and Loga- 


rithms—functions found in 
most spreadsheets—Calc II 
offers Rnd for random num- 
bers, Peek to return a value 
of a memory byte, and Exp 
for exponents. Additional 
functions include Average, 
Minimum and Maximum val- 
ues, and Number of Items in 
a block of data. Lookup and 
Index are functions used to 
find data in tables. Fix trun- 
cates remainders in calcula- 
tions, and Round rounds the 
value up or down. An If func- 
tion lets you make a choice 
between two options. How to 
use these and other func- 
tions is carefully explained in 
the manual. 

A spreadsheet is a very 
powertul yet flexible tool that 
lets you perform a wide 
range of mathematical calcu- 
lations. It's a productivity 
package you'll use again 
and again. If you don’t have 
a spreadsheet, | recom- 
mend that you get one. 
Once you decide to get one, 
| heartily recommend Calc Il. 
TOM NETSEL 


Commodore 64 and 128—$29.00, 
plus $4.95 shipping and handling 


PANKHURST PROGRAMMING 
P.O. Box 49135 

Montreal, PQ 

Canada H1N 316 


Circle Reader Service Number 342 


BAD BLOOD 


Mutants get no respect! In 
most computer games, mu- 
tant creatures are monsters 
or enemies. Found roaming 
in dungeons or forests, 
these creatures are simply a 
source of experience points 
and useful objects left be- 
hind after termination. Bad 
Blood, from Origin, is an ad- 
venture game that takes 
place in a postapocalyptic 
world in which the mutants 
are the good guys and the hu- 
mans are corrupt and vindic- 
tive. There’s a lot of bad 


SOFTWARE 


CLOSEOUTS 


For Commodore 64 & 128 


‘STRATEGIC SIMULATIONS INC. (SSI) $19.50EACH 
Typhoon of Steel, War of the Lance, Curse of 
Azure Bonds, Poo! of Radiance, Countdown to 
Doomsday, Battles of Napoleon, Tony LaRussa 
Baseball, B-24, Roadwar 2000, Hillsfar, First 
over Germany, Heroes of Lance, Pro-TourGolf, 
Battle for Normandy, Dragons of Flame or 
Dragonstrike. 

oe SV4,S0EACH 
Acrojet, Destroyer Escort, Netherworid, Rick 
Dangerous, Top Gunner, Xenophobe, Crusadein 
Europe, Decision in the Desert, Spitfire Ace, 
Helicat Ace, Solo Flight, Silent Service, Conflict 
in Vietnam, Stunt Track Racer, 3D Pool, F-15 
Strike Eagle, Airborne Ranger, or Pirates! 
ACCOLADE BARGAINS .... +» $5.00 EACH 
PSI5 Trading Co., Law of the West, Comics, 
Killed Until Dead, Hardball, Dambusters, Ace of 
Aces, Fight Night, orJet Boys. 
TATOPREMIUMTITLES os STA.SOEACH 
Alcon, Arkanoid, Arkanoid |!, Bubble Bobble, Qix, 
Operation Wolf, Rambolll, Rastanor Renegade. 
ACTIVISION BARGAINS .... +» $5.00 EACH 
Toy Bizarre, Mindshadow, H.E.R.0., Crossbow 
Championship Baseball, Zenji or Powerdrift. 
ACTIVISION PREMIUM TITLES M4.50EACH 
Gee Bee Air Rally, Aliens, Ghostbusters Il, 
Maniac Mansion, Beyond Dark Castle, Titanic, 
Space Shuttle, Christmas Model Kit, Mondu’s: 
Fight Palace, or Die Hard. 
INDSCAPELIQUDATION.. 


BSDEAH 
Mastertype/Writer Bundle, Perfect Score SAT, 
Shinobi, Gauntlet 2, Bop'nRumbie, Color Me, 
Combat Course, Intothe Eagle's Nest, Indoor 
Sports, Boston Computer Diet, Songwriter, 
Thunderblade, Golden Oldies. 


COMPSULT 
P.O. BOX 5160 
SAN LUIS OBISPO 
CA 93403-5160 


disk! 


COMPUTE. 


|AVALONHILL GAME COMPANY .. ‘$10.00EACH 
Under Fire, MacBeth, Wooden Ships & Iron Men, 
Ripper!, Tsushima, Stocks & Bonds, Dr. Ruth, 
Parthian Kings, Jupiter Mission 1999,T.A.C., 
[Legionnaire, Tournament Golf, Maxwell Manor, 
Statis-Pro Baseball, Gulf Strike, Darkhorn, 
|Guderian, Mission on Thunderhead, Panzers East, 
Super Sunday, or Panzer Jagd. 


INFOCOM BARGAINS .OOEACH 
Starcross, Suspended, Zork2or3, or Deadline. 


|MOREGREATDEALS!!!!!! 
Printed Word or The Tool, by Valueware ..... 
Partner 128 (cartridge forC/128 only), 


Super Expander 64 (cartridge), by Commodore ..... 
Assembler, byCommodore .... 

Pet Emulator, by Commodore 
Entertainer or Educator, by Val 

Tri-Math or Turtle Toyland, by HesWare .. 
Attack ofthe Mutant Camels (cartridge), by HES $3.50 


Iron Lord, Puffy's Saga, Skate Wars, BA T.., Pick'N Pile 

IChessmaster2100, by Software Toolworks $14.50 

Dragon Wars -or-Neuromancer, Interplay. ! 

Heatwave -or-Steel Thunder, Accolade. 

TONS OF ADDITIONAL ITE! 
viMODORE 64/128...IN ST! 


TO ORDER: Send check or money order, includin 
shipping charges of $5 for U.S.A.,$8for Canada, $12al 
others. California addressesmust include 7.25% sales 
tax. To receive our complete catalog of over 2,000 items 
{or all computer types. send $2 in cash or postage 
stamps. The catalog is FREE with any order. To check for 
anitem not listed here, cal (805) 544-6616, 


WE ALSO CARRY LOTS OF 
SOFTWARE FOR IBM, APPLE, MAC, 
AMIGA, ATARI & MORE! 


Circle Reader Service Number 181 


New on the Gazette Disk! In addition to the 
programs that appear in the magazine, you'll also 
get outstanding bonus programs. These programs, 
which are often too large to offer as type-ins, are 
available only on disk—they appear nowhere else. 
As another Gazette Disk extra, check out 


Yes, save time and money! Subscribe to the Gazette 
Disk and get all the exciting, fun-filled Gazette pro- 
grams for your Commodore 64 or 128—already on 


Subscribe today, and month after month you'll 
get all the latest, most challenging, and fascinating 
programs published in the corresponding issue of 


day to COMPUTE’s Gazette Disk and get 12 issues 
for only $49.95. You save almost 60% off the single- 
issue price. Clip or photocopy and mail completed 
coupon today. 


$9.95 (plus $2.00 shipping and handling) by writing 
to COMPUTE, 324 West Wendover Avenue, Suite 
200, Greensboro, North Carolina 27408. 


“Gazette Gallery,” where each month we present the 
very best in original 64 and 128 artwork. 


FLORIDA’S OLDEST & LARGEST 
COMMODOREIAMIGA 
FACTORY DIRECT DEALER 
AUTHORIZED SALES & SERVICE 


1-800-749-2225 


AMIGA-64/128-XT/286/386/486 


AMIGA 500DS 


512K RAM, 880K FLOPPY DRIVE, MOUSE, 4096 COLORS, 
WORD PROCESSOR, PAINT PROGRAM, F/A-18 INTERCEPTOR, 
F40 PURSUIT, INDIANA JONES & JOYSTICK 


$389.00 


GENUINE COMMODORE 501 RAM EXP...,.$69.95 
GENUINE COMMODORE A1011 EXTERNAL FLOPPY DRIVES.....$129.95 
CALL FOR OTHER SUPER PRICES 
NO TRADES NECESSARY!!! OFFER EXPIRES JUNE 39, 1992 


NEW 1084S MONITORG.....$299.00 
AMIGA 520 VIDEO ADAPTERG.....$39.95 


= 
| 
| 
| 
| 
| 
| 


JECT TO A20% RESTOCKING 


NEW AGE ELECTRONICS 
13553 66TH STREET NORTH 
LARGO, FL 34641 
PH: (813) 530-4561 _FAX: (813) 530-0799 BBS: (813) 360-7062 
COME VISIT US WHEN YOU VISIT FLORIDA 
ONLY 90 MINUTES FROM DISNEYWORLD IN 
SUNNY TAMPA BAY! 


‘FEE. NO RETURNS AFTER 30 DAYS. 


Circle Reader Service Number 194 


So don’t waste another moment. Subscribe to- 


Individual issues of the disk are available for 


YES! Start my one-year subscription 
to COMPUTE’s Gazette Disk right away 
for only $49.95.* 


O Payment enclosed (check or money order) 


OCharge MasterCard O Visa 
Acct. No. Exp. Date 
Signature 
(Required) 
Name 
Address 
City 
State/ ZIP/ 
Province Postal Code 


Mail to COMPUTE's Gazette Disk, P.O. Box 3250, Harlan, 1A 51593-2430 


“Residents of NC and NY, please add appropriate sales tax for your area. Canadian 
orders, add 7% goods and services tax. 


S 
4 


91 
Gazette 
Index 


Everything’s included! 
Features, games, reviews, 
education/home applications, 
programming, bugswatter, 
feedback, and columns! 


A superb interface includes pull-down 
menus, help screens, and keyboard, 


joystick, or mouse control. Features in- 


clude super-fast searching and sorting 
capabilities. An options screen allows 
you to choose text colors, drive num- 
ber, and input device. And there’s full 
documentation on disk. 


Choose from three modes of opera- 
tion—browse for quick scanning, view 
for detailed information and descrip- 
tions, and edit for adding items from 
upcoming issues—and print to any 
printer. There’s even a turbo-load op- 
tion for maximum disk-access speed. 


ORDER YOUR 
1991 GAZETTE 
INDEX TODAY! 


(MasterCard and Visa accepted on 
orders with subtotal over $20.) 


To order, send $7.95 per disk, the 
quantity of disks ordered, check or 
money order,” your name and com- 
plete street address: 


1991 Gazette Index 

324 West Wendover Avenue 
Suite 200 

Greensboro, NC 27408 


"Please add $2 shipping & handling ($5 foreign) for 
each disk (residents of NC, NJ, NY please add appli- 
cable sales tax; Canadian orders, add 7% goods and 
services tax). 

All payments must be in U.S. funds. Please allow 4 
weeks for delivery. 


REVIEWS 


blood here. Your goal is to bring peace 
to the Plains and prevent war between 
the mutant races and the humans who 
want to control and enslave them. 

You start Bad Blood in the mutant 
town of Mardok. After watching an in- 
troduction, you choose a character for 
the game. The choices are Varigg, Ja- 
kka, and Dekker. Varigg is a green 
male, full mutant. Jakka is a female mu- 
tant, almost human except for her eye 
blasts. Dekker is a male human. All the 
characters have qualities that make 
them attractive alter egos. Their weak- 
nesses make the game a different chal- 
lenge with each character. 

Bad Blood takes place on the Plains, 
a land laid to waste long ago by a nu- 
clear bomb. The inhabitants managed 
to survive, but not without mutations. 
The humans tried to ignore the mutants 
and enslaved them. As time wore on, 
the mutants rebelled and formed their 
own communities. In addition to moun- 
tains and open spaces, the Plains con- 
sists of mutant towns Mardok, Okkarn, 
Niwik, and Kitrum; human cities Xantin- 
ium and Yvrium; and a dangerous shell 
of a city called Zero City. 

Bad Blood’s game screen features 
an overhead view of your character's 
surroundings in a mock television cab- 
inet. Below this window on the left is a 
list of five commands; a jar of brown flu- 
id on the right marks the character's 
life level. The commands are Inventory, 
Examine, Use, Talk, and Options 
(Pause game, Save game, Load game, 
and Music on/off). To play Bad Blood, 
move the character around in the top 
window with joystick or keyboard and 
select commands with the joystick but- 
ton or space bar. The first three com- 
mands bring up an inventory window for 
further choices. 

It's necessary to carry on a lot of con- 
versations with people you meet in Bad 
Blood. They'll provide clues and other 
necessary information. Selecting the 
Use command brings up another menu 
with options to chat, ask a character 
about a specific topic from another list, 
or say goodbye. 

Finally, in combat, you use a weap- 
on or bare hands to attack by pressing 
the joystick button or space bar. That's 
all there is to Bad Blood. You'll be play- 
ing the game in no time. 

Bad Blood possesses the right diffi- 
culty for beginners, and seasoned ad- 
venturers will enjoy the atmosphere of 
the game and the strange characters. 
The well-written manual details the his- 
tory of the Plains and also explains the 
slang of the region, such as tuff (warri- 
or or soldier), hume (human), and mute 


(mutant). It's a fresh perspective to see 
the entire game on one scale, as is not 
the case in a lot of other role-playing 
games. You only see the interiors of 
buildings when you enter the doors. 
Bad Blood takes advantage of its 
game world and contains a lot of interest- 
ing mutants, not all of whom are friend- 
ly. Just remember to watch out for the 
reptilian Kejek creatures; they capture 
other mutants as slaves for the humans 
in exchange for big rewards. 

The graphics in Bad Blood are top- 
notch. The overhead view is particular- 
ly impressive because of the detail it pro- 
vides. Scrolling is smooth and fast. The 
only time the game halts and accesses 
the disk is when you enter a building or 
move into a new area of the Plains. For- 
tunately, this access time is short. Bad 
Blood's graphics bring the mutants to 
life and offer a rich environment for ex- 
ploration. The catchy music is constant 
throughout the game and adds a lot to 
the enjoyment. Sound effects are not as 
prevalent. 

Bad Blood is a fine example of how 
much more enjoyable a game can be 
with a simple control system. Bad 
Blood's interesting land and inhabitants 
make this game an ideal choice for 
adventure fans. 

RUSS CECCOLA 


Commodore 64 and 128—$49.95 


ORIGIN 

P.O. Box 161750 

Austin, TX 78716 

(512) 328-0282 

Circle Reader Service Number 343 o 


This publication is 
available in microform 
from UMI. 


Please send me information about the titles 
I've listed below: 


Name. 


Title. 
Company/Institution. 
Address 
City/State/Zip. 

Phone (. 


UMI 

A Bell & Howell Company 

300 North Zeeb Road, Ann Arbor, MI 48106 USA 
800-521-0600 toll-free 

313-761-4700 collect from Alaska and Michigan 
800-343-5299 toll-free from Canada 


LOTSA DISKS! THE BEST in 64/128 PD. 
GEOS, Graphics, Clipart, Demos, Games, Bible, 
SID/MIDI, Educational, Basic 8 
NEW! Graphics Scanning Service 


Send stamp for FREE catalog or $2 for sample disk. 


OVYEMES Diskoveries 
The Best 
in PD Software 


PO Box 9153, Waukegan, IL 60079 
Circle Reader Service Number 190 


Commopore_e 64 PuB_Lic DOMAIN 


Highest Quality Since 1987* 
Games, Education, Business, Utilities, GEOS, Music, Graphics & 
More. As low as 90¢ per collection. 1 stamp for complete catalog 
or $2.00 for catalog AND 30 sample programs (refundable). 
24 hour shipping. 

64 DISK CONNECTION 


Suite 562 - Virginia Beach, VA 23452 
Formerly RVH Publications) 


4291 Hollan 


Circle Reader Service Number 254 


KODEKRAKR LTD. 


Proudly presents a new innovation in software security check DE-protection! PASSCODE 
KRAKR! removes time consuming and often annoying documentation security checks in 
many of your games software programs. Lists are continually updated with the latest and 
greatest software releases available on disk! System also uses parameters which are easily 
updated with our "newest releases’ list. Also available—THE PARAMETER HOTLINE—call 
‘on us to customize your favorite (registered owners only)! Don't let lost documents ruin 
another expensive program. TO ORDER CUSTOMIZATION PACKAGE, send $21.95+$4.00 


SIH to: 
i KopeKraker Ltp. 
761 Meade Lane * Virginia Beach, VA 23455 


Circle Reader Service Number 223 


Upgrade yourCommodoresystem 


Refurbished Hardware New APROTEK modems 
MONITORS DRIVES OTHER 64/1 28/AMIGA-2400 BAUD- $119 
1701 -$235 1541-$100 1660-$30 64/1 28/AMIGA-1200 BAUD - $89 
1702-$255, 1541-l1-$120 1670-$50 APROSAND-4 SLOT CARTRIDGE 
1801 -$265, 1571 -$165 (C64 -$100 EXPANDER FORTHE 64/128- $40 
1802-$285 1571-Il-$165 64C-$120 New CMD accessories 
1901 -$295, 1581 -$180 C128-$175 JIFFYDOS 64/1288 ANYDRIVE “SYSTEM*-$85 
1902-$305 1O01SFD-$150  C128D-$225 128D/ANY DRIVE “SYSTEM" - $95 
10846-$325 1530 DATASETTE-$35 ADDITIONAL DRIVE ROMS - $45 


MANY BOOKS- $10 
ASKFORANYTHNG, | MIGHT 
JP. PBM PRODUCTS BY MAIL 

O. BOX #1233, STATION B 

WESTON, ONTARIO, M9L2R9 


Palins $1020 RAMUNK/RAMCARD CW BATTERY (OMb)-$345_ 
1Mb RAMSIMM-$75 4b RAMSIMM -$250 
‘SHIPPINGINCLUDED FOR CANADA, USA +$10 
15DAY WARRANTY ON REFURBISHED GOODS 
SENDA SASE FOR FREEINFO 


C64/128 PUBLIC DOMAIN SOFTWARE 
REQUEST FREE CATALOG or send $2 for sample disk and catalog (RE- 
FUNDABLE). Categorles Include education, utilities, games, business, 
PRINT SHOP graphics, pre-tested programs and more. Rent for 75¢ or 
buy as low as $1.00 per disk side or for 80¢ for 70 or more. $20 order 
gets 4 free disks of your choice. 

NEXT DAY SHIPPING! 
& CALOKE INDUSTRIES (Deft @K) 


PO BOX 18477, RAYTOWN, MO 64133 


SINCE 1986 


Circle Reader Service Number 255 


COMPUTER 
. _ 205-739-0040 


(= AUTHORIZED COMMODORE SERVICE CENTER 


MOTHERBOARD REPAIR (Send Board Only) 

64, 1541...... $39.00 128, 1571...... $59.00 
COMMODORE DISK DRIVES COMMODORE COMPUTERS 
1541... $49.00 C-64 


C-128. 
COMMODORE MONITORS SX-64 Portable.. 
1701, 1802, 1084, COMMODORE PRINTERS 
1702, 1902...... $85.00 
Amiga 
Call for price 


'!! FAST TURNAROUND !!! 


All parts and labor included. $7.50 shipping. 
$15.00 APO and business equipment. 


WE BUY ALIVE CABLES AND MISC. PARTS 
C64 $ CALL | REG6PIN DIN $ 4.45 | 901 ROMS $11.95 
1541 NEWT CALL | 12'6 PIN DIN 6.95 | STR54041 12,50 
1541 ALPS CALL | 18'6 PIN DIN 7.95 | 41464 9.95 
SX64 CALL | MONITOR CABLES 4.45 | 6560 PULLS 10,00 
1571, C128 CALL | TV SWITCHES 2.50 | 74LS629 4.95 
1526/802 CALL | COMMODORE 82S100 12.95 
MUST BE COMPLETE KEYBOARD CALL | 325302 9.95 
$CALL ON DEAD DSDD-Disk 25 for 11.95 | 325572 9.50 


EQUIPMENT 8701 


POWER SUPPLIES COMPUTER EQUIPMENT 


C64 $ 24.95 | C64 REFR $ 99.00 | 6522 4.50 
C128 49.95 | C128 REFR 219.00 | 6520 3.85 
1541, 1581 36.75 | 1702 CBM 169.00 | 6532 6.29 
AMIGA 500 75.95 | CBM 1541 ALPS 159.00 | 6502 2.85 
AMIGA 1000 134.95 | STARNX1000C 199.00 | 6510 9.95 


AMIGA 2000 141.98 | EPSON INTERFACE 53.95 


COMPUTER SHOPPE OF ALABAMA 
1310 2nd Ave. NW, Suite C 
Cullman, AL'35055 ee eee oa'en 


PRICE SUBJECT TO 
CHANGE 


DEALERS SEND FOR $25.00 MIN ORDER 


PARTS CATALOG 


Circle Reader Service Number 178 


Calc li makes your math work a breeze | of cata * Uppercase, lowercase and 
= whether it's a mortgage caicuiation, | Commodore graphics all avaliable * Bar 
‘budgeting, orkeeping sports statistics. | graohs on-screen with text * Over two 
(Or use it for your non-math chores like | dozen functions, including LOOKUP, 
organizing phone numbers or maknga | AVG, IF, RND, SIN & FIX * 240 rows by 
shopping Est! 240 columns * Easy to remember com- 
© Uses Commodore math routines for | mands * Uses disk or tape * Smple 
power and speed * gets results twice | worksheet setup ¢ Easy text entry. 
85 fast as competitor's * ideal for | The Package includes a Detailed User's 
Spreadsheet databases ~ sot by row or column * | Guide with quick start info and 
‘View lots of information fast with up to | spreadsheet tips. Also on disk with Calc 


for the 
column locking * Quick, responsive 


Commodore 64 unorng » dependent acatane | $4.95 shoo and handing). Please 
laces, width and postioning | alow 4-7 weeks for delivery. 


PANKHURST PROGRAMMING P.0.Box 49135 * Montreal * Quebec * Canada * HIN 3T6 
Circle Reader Service Number 152 


The Fastest 


New for the C128! KeyDOS ROM! 


The KeyDOS ROM is a chip for the empty socket inside your C128 and adds more than 


40 new instantly av: ures only a keypress or two away! 
20 KeyDOS F keys for simple “point iple drive access. All major DOS functions. Fast- 
load C64 programs in 128 mode, view SEQ files, execute batch files. Print, copy, view, scratch or 
rename multiple files. ASCII/CBM converter. Full 1581 subdirectory support! RAMDOS supports 
REUs up to 2MB. GEOS RBoot. Disk editor, ML debugger, alarm clock, screen dump editor. 
LOTS MORE! Satisfaction Guaranteed! Write for more information. 
Only $32.50. See why C128 users say that KeyDOS ROM is a MUST! 


Antigrav Toolkit, PO Box 1074, Cambridge, MA 02142 
Shipping outside of US, Canada and Mexico add $3 


Circle Reader Service Number 155 


Here’s an interesting 
Way to tum 
keyboard characters 


into sprites, 
and move them about 
with cursor Keys. 


G-18 


BEGINNER BASIC 


Larry Cotton 


ALPHABET SPRITES 


Let's transfer data from the 
64's built-in character set to an 
interesting sprite format. 
Lines 10-110 contain famil- 
iar sprite code, except for con- 
stant definitions in lines 50 
and 60, which we'll look at in 
a moment. Line 120 begins a 
FOR-NEXT loop to copy three 
groups of character data. 
Lines 130 and 170 access 


226 
236 
248 
256 
266 
276 
286 
296 


366 


POKE211,17:PRINT" 
KEYS" 
POKEV+21,1:REM SP 
RITE ON 
KB=197:SH=653:NK= 
64:MX=255 
K=PEEK (KB) +PEEK(S 
H) : IFK=NKTHEN24G 
IFK=7THENY=Y+1 
IFK=8THENY=Y-1 
IFK=2THENX=X+1 
IFK=3THENX=X-1 
X1=INT (X/MX) :X2=X 
-X1*MX 
POKEV, X2: POKEV+16 


COMPUTE JUNE 1992 


RJ 10 PRINTCHRS$ (147) : POK 
E646,7{10 SPACES} 
JD 26 PRINTTAB (16) "PLEAS 
E WAIT 3 SEC. 
RC 30 V=53248:REM 1ST SP 
R CTRL REGISTER 
HD 48 POKEV+21,0:REM TUR 
N SPR 1 OFF 
HG 50 X$="ABCDEFGHIJKLMN 
OPQRSTUVWXYZ":REM 
{SPACE}SEE LINE 33 
6 
RA 60 S=6656:E=8:REM SEE 
LINE 146 
BD 70 POKE2046,192:REM P 
OINT TO DATA 
PC 8G REM POKEV+23,1:POK 
EV+29,1:REM ENLARG 
E 
EP 90 POKEV+39,7:REM YEL 
LOW SPRITE 
PX 106 X=160:Y=130:POKEV 
,X:POKEV+1,Y:REM 
{SPACE }LOCATE 
HM 11@ FORB=12288T012350 
: POKEB, @:NEXT:B=1 
2288:REM CLEAR SP 
RITE DATA AREA 
FG 12@ FORG=1T03:GOSUB32 
6 
SM 13@ POKE56334,@:POKE1 
,51:REM KBD OFF 
DR 14¢ FORI=GTO21STEP3:Z 
=(T+S) *E:POKEB+I, 
PEEK(Z+A):REM COP 
Y CHARACTER DATA 
XK 156 A=A+1:NEXT:A=6:B= 
B+l 
GA 16@ NEXT:B=B+21:GOTO] 
26 
SB 176 POKE1,55:POKE5633 
4,1:REM KBD ON 
AM 18@ PRINTCHRS$(147) 
FB 196 POKE214,9:PRINT:P 
OKE211,17:PRINT" 
{3 SPACES}SS":REM 
3 SPACES BEFORE 
{SPACE}SS 
MQ 26@ POKE214,16:PRINT: 
POKE211,17:PRINT" 
{3 SPACES}SOR":RE 
M 3 SPACES BEFORE 
SOR 
XB 216 POKE214,11:PRINT: 


,X1:POKEV+1,Y:REM 
MOVE SPRITE 
GOTO240 
READAS: IFAS="*"TH 
EN170 
FORT=1T026:IFAS=M 
ID$(X$,T,1) THENRE 
TURN 
NEXT 
DATA P,R,E,C,U,Ry 
the character ROM located 
from 53256 through 53463. 
POKE 56334,0 turns off the key- 
board, while POKE 1,51 switch- 
es the character ROM in. 
When the copying is com- 
plete, the two memory regis- 
ters must be restored to nor- 
mal with POKE 1,55 and 
POKE 56334,1. The order of 
poking in line 170 must be re- 
versed from that of line 130. 

Between lines 130 and 170, 
the ROM-to-sprite data copy- 
ing occurs. We set up the 
sprite's shape data in memory 
registers 12288 through 
12350; B is 12288. Recall that 
each sprite shape is defined 
by 63 bytes (three columns of 
21 bytes). The first letter 
whose 8 bytes of data we'll 
transfer will appear in the up- 
per left corner of the sprite, con- 
trolled by addresses 12288, 
12291, 12294, and so on. 

A FOR-NEXT loop from 0 to 
21 in line 140 begins copying 
the eight bytes of character da- 
ta. STEP 3 ensures that the da- 
ta bytes fall under each other 
in the sprite so the character 
will be readable. Z is the ROM 
location of the character data. 
Its value is calculated by add- 
ing constant S and variable T 
and then multiplying by con- 


316 
JE 326 


HP 336 


FG 
HD 


346 
356 


stant E. (S and E are defined 
in line 60.) T comes from a sub- 
routine in lines 320-350, 
which is called from line 120. 
Let's look at that subroutine. 

AG is a letter of the alpha- 
bet. X$ (the alphabet, defined 
in line 50) is scanned for a 
match, T indicates A$’s place 
in the alphabet. Thus, if A$ is 
the letter C, T will equal 3. The 
subroutine returns control to 
line 130. T is then added to S 
in line 140, which determines 
Z's value—the place to begin 
peeking for character data. 

In line 140, the first time 
through the loop, B is poked 
with whatever's in Z. However, 
line 150 increments A (which 
starts as 0) by 1, so the next 
time through the loop, B+3 is 
poked with whatever's in Z+1. 
Thus, as the sprite data reg- 
isters are increased by three, 
the character data registers 
are increased by one. 

After the loop is finished in 
line 150, Ais reset to 0, and B 
is increased by 1. The next 
two characters will be placed 
to the right of the first one in 
the sprite; the FOR-NEXT loop 
is finished in line 160. Finally, 
B is increased by 21, and an- 
other loop begins in line 120. 
This places three more charac- 
ters under the first three. 

Lines 180-310 print a mes- 
sage and illustrate a sprite- 
moving technique via the cur- 
sor keys. Line 230 looks at 
memory locations 197 and 
653, which track keyboard 
presses. The sum of their 
peeked values equals 7, 8, 2, 
or 3, corresponding to down, 
up, right, and left cursor move- 
ments. Line 290 converts the 
sprite’s horizontal position to 
pokable values for the two 
horizontal-position memory reg- 
isters 53248 and 53264. Line 
300 does the actual poking. 

Experiment by deleting the 
first REM in line 80 and the print- 
ing in lines 190-210. Try other 
values for S in line 60, X$ in 
line 50, and 26 in line 330. G 


APEVINE GROUP ,_.. 


Inc 


COMMODORE UPGRADES 


i NEW POWER SUPPLIES 


© A superheavy, repairable C-64 power sup- 
ply with an output of 4.3 amps (that's over 3x 
@s powerful as the original). Featuring 1 year 
warranty, ext. fuse, schematics, UL approved. 
Cost is $37.95 and includes as a bonus the 
Commodore Diagnostician II (valued @ $695) 
‘© 4.3 amp supply for C-128, Same features as 
above—$39,95 (includes bonus package) 

© Our Biggest Seller © 1.8 amp repairable heavy 
uty supply for -B4, (Over 120,000 sold.) . . $24.95 


& EMERGENCY STARTUP KITS © 


Repair your own Commodore/Amiga and save 
i lots of money. Kits contain all major chips 
* schematics, diagnostics, etc. No soldering 
' Send for full details. Five different kits 
available, 


512K RAM EXPANDERS 


Super 1750 REU CLone (512K), Does not 
require a larger power supply ...... $142.50 
“Original REU-1750 512K Expander Unit... $131.00 


COMMODORE DIAGNOSTICIAN II 


Originally developed as a software package, 
then converted to a readable format, the 
Diagnostician has become a fantastic seller 
With over 38,000 sold worldwide, Diagnosti 

‘cian I utilizes sophisticated cross-reference 

32 grids to locate faulty components (ICs) on all 
C-64 and C1541 computers (C-128/64 mode) 
Save money and downtime by promptly lacat- 
ing what chip(s) have failed. (No equipment of 
any kind needed.) Success rate {rom diagnosis: 
to-repair is 98%. Includes basic schematic. $6.95 
(Avail for Amiga computers with 398" disk at $1495.) 

== 
VISA 
a 


Send For Free 36 Page Catalog 
3 CHESTNUT ST,, SUFFERN, NY 10901 


SPECIALS 

© COMPUTER SAVER: This C-64 Protection 
System saves you costly repairs. Over 52% of 
C-64 failures are caused by malfunctioning 
power supplies that destroy your computer 
Installs in seconds between power supply & 
©-64. No soldering. 2 year warranty. An 
absolute must and great seller 

© PRINTER PORT ADAPTER by Omnitronix 
Avoid obsolescence. Allows you to use any 
Commodore (C-64) printer on any PC compati- 
ble or clone. Does not work with 


PRINTHEAD REFURBISHING 


Save time and money by having your tired 
worn-out or damaged printhead refurbished or 
remanutactured at a fraction of the cost of anew 
one, Features low cost, 5 day service and 1 
year warranty. For example: Okidata 80/90/ 
100 heads are $64.95; Epson (9 Pin) EX/FX/ 
LX are $69.95. 


REPLACEMENT/UPGRADE 
CHIPS & PARTS 


6510 CPU. 


PLA 906114 
All 901/225-6-7-9 
4164 (C-64/RAM) .. 
C-128 ROMs Upgrade (set 3). 
C1571 ROM Upgrade (310654-05 
C-64 Keyboard (ne 
Commodore Cables 
Service Manuals fo 
1084, 1541 .. 


Order Line 1-800-292-7445 Fax 914-357-6243 


We Ship Worldwide 


Hours: 9-6 E.S.T. M-F 914-357-2424 Prices subject to change 


Tell a friend you've heard it through the Grapevine. 


Big Blue Reader 128/64 - 4.0 


Transfers word processing, text, ASCII, and binary files between 

64/128 and IBM PC compatible 360K 5.25" and 720K 3.5” disks. 

New Version 4.0 features: Transfers ASCII, PET ASCII and Screen 

Code files including: WordWriter, PocketWriter, SpeedScript, PaperClip, 

WriteStuff, GEOS, EasyScript, Fleet System and most others. 

Supports drives # 8-30. New Backup (C128) and Format (1571/1581) 

programs. Reads MS-DOS sub-directories, uses joystick, and more. 

Includes C64 & C128 programs. Requires 1571 or 1581 Disk Drive. 
Big Blue Reader 128/64 - 4.0 only $44.95 


Version 4.0 upgrade, send original BBR disk plus $18. 


Bible Search 3.2 


. Entire Old and New Testament text on 4-1541/71 or 2-1581 disks. 

. Exhaustive English Concordance on 2-1541/71 or 1-1581 disks; 
includes more than 700,000+ references. 

. Incredible five (5) second look-up time per/word, per/disk. 

. Instant, automatic spell checking of more than 12,800 words. 

. Boolean search options, including AND, OR & NOT logic. 

. Search the entire Bible in 5 seconds with 1581 or HD (v3.52). 

7. Money Back Guaranteed! 

Includes: C64 & C128 programs; printer and disk output, users 

guide, disk case. Available on (7) 1541/71, or (4) 1581 disks. 


KJV $49.95 vxvevevrve NIV $59.95 
© Any questions? Call or write for more information. 
Also available! Amiga, Bible Search 


DPwO Ne 


ey order, or COD. US funds only. 
in US. No Credit Card orders. 
Canada & Mexico add $4 S/H, Overseas add $10 S/H ($5 BBR) 


SOGWAP Software ® (219)724-3900 


115 Bellmont Road; Decatur, Indiana 46733 


Order by check, mon: 
i Fl i} i 


Circle Reader Service Number 145 


PO BOX 542 
LINDENHURST, NY 
11757-0542 


(516) - 957-1110 


6PAC#B: 6 DISK SET FOR ONLY $5.00 


MARIO BROS - Super Mario Bros, Mario II, Marios Brewery, + 
ARKANOID - Artzoaid I, Krakout Pro? & Prot, Adictaball 
GENEOLOGY - (2 disks) PEDIGREE V3.0 Your family tree ! 
‘TRIVIA CONST. SET - Mato your own Trivis Whiz Game 
COMPUTER AIDED DESIGN - C.A.D. ¥3.0 


6PAC#C: 6 DISK MUSIC SET FOR $5.00 


T.V. THEMES - Hill St, MacGyver, Letterman, LA.Law, Moro} 
MOVIES - (wipictures) Somewhere Out There, NY. NY. & More 

ASSORTMENT - Danger Zone, Elvis Tribute(w/picture), More 
60's POP - Light My Fire, California Dreamin, Fire & Rain, More 
PROGRAMS - Pitch Pipe,Piano,Organ, ET Theme, Bach, More 
SOUND F/X - Tarzan, U2, Werp, Volcan Mind,Try/Think, More 


ADD $2.00 SHIPPING FOR TOTAL ORDER 
U.S. FUNDS ONLY! SORRY NO C.O.D.’S 
ACOPY OF OUR CURRENT CATALOG 
WILL BE SENT WITH ALL ORDERS! 
OR CALL TO RECEIVE A COPY FREE 
MONDAY-FRIDAY 10:00AM TO 5:00PM EST 


Circle Reader Service Number 162 


DISKS O'PLENTY INC 
7958 PINES BLVD. SUITE 270A 
PEMBROKE PINES FL 33024 
(305) 963-7750 
Call or write for free descriptive catalog of 
C64/128 Public Domain & Shareware 
Choose from over 900 Disks 
Adult list of over 50 Disks available 

to those 18 or over. 
021MU_ SID MUSIC UTILITIES 
019GR_ PRINTSHOP UTILITIES 
019ED JRHIGH EDUCATION 
062ED HIGH SCHOOL EDUC. 
033ED TYPING / SPANISH 
031ED COMPUTER SCIENCE 
010UT PIRATES TOOLBOX 
119GA FOREIGN ARCADE 
022GA CASINO-BOARD GAMES 
021GE GEOS FONTS 
002MS LOTTERY PROGRAMS 
003MS COLLECTORS CORNER 


Circle Reader Service Number 253 


Choose 6 for $5.00 
LIMITED OFFER 


American Heart 
Association 


Can Your 
Computer Make 


WITH LOTTERY PC YOUR NEXT TICKET 
COULD BE WORTH MILLIONS! 


LOTTERY uses the raw power and storage of your 
computer to determine and refine the number selection 
methods that will win the various lottery games 
play. Don't be limited to the one or two methods that 
other programs use, they might not work in your state. 
There is no better system available! 

Join the growing list of winners using our system. 


SPECIFY: 
Lottery 64(C64/128) 
Lottery PC 
IBM PC/XT/AT and compatibles 


Commodore64/128 & Plus/4 are registered 
trademarks of Commodore Int 
IBM PC/XT/AT are registered trademarks of 
International Business Machines Inc, 


To order, send $29.95 for each plus $3.00 postage & 
handling per order to 

(Illinois residents add fe sales tax) 

(Grders outside North America add $3.00) 


C.0.D. orders call: 
(708) 566-4647 


26151 N. Oak Ave. 
Mundelein, IL 60060 


ce) 


Circle Reader Service Number 221 


Here’s a method 
to determine 


a program’s starting 


whether it’s a BASIC 


language program. 


G-20 


COMPUTE JUNE 1992 


MACHINE LANGUAGE 


Jim Butterfield 


ROTATING 
BUFFERS 


You may recall an earlier ex- 
pedition into hexadecimal num- 
ber printing. In this column, 
we'll expand on that subject. 

Here's what this program 
will do. The user names a pro- 
gram file. Our program exam- 
ines that file and reports two 
things: the load address and 
whether or not the last three 
bytes of the file are 0. The 
load address of a program 
gives you a hint as to whether 
this is a normal program (gen- 
erated with a SAVE com- 
mand) or an unusual one that 
will need to be brought in with 
a LOAD “filename",8,1 com- 
mand. Normal load addresses 
vary from computer to comput- 
er, but these addresses al- 
most always end with hexadec- 
imal digits 01. 

If the load address ends 
with digits 01, our program 
will read the rest of the file to 
catch the last three bytes. If 
each of the three are 0, the pro- 
gram will print ALL BASIC. 

For example, a program 
with a load address of $0801 
that ends with three binary Os 
is more than likely a BASIC lan- 
guage program that was prob- 
ably saved on a 64. That 
means it can be loaded with 
the normal ,8 extension. 

The program must read all 
the bytes of the file in order to 
catch the last three, but it 
doesn't need to save all those 
bytes that it encounters first. A 
buffer large enough to hold 
three bytes is all that’s re- 
quired. As the data bytes 
come from the file, they'll be 
stored in one of these three ad- 
dresses. A pointer will move 
across the three locations, loop- 
ing around as needed. In oth- 
er words, we have a rotary buff- 
er. When we finally see the 
END OF FILE signal, the con- 
tents of those three locations 
will be the pieces of informa- 


tion that we want to know. 

The BASIC program first 
pokes the machine language 
code in place. Then it asks for 
a filename and opens logical 
file 1. The machine language 
program is called in to do the 
main job. When control returns 
to BASIC, the file is closed, 
and the program is finished. 

Note that the file is opened 
and closed from BASIC. Al- 
though we could do the same 
job from machine language, 
we'd save little time or memo- 
ry. It's nice to have BASIC on 
hand for such jobs. On other 
computers, BASIC wouldn't 
be there, and you'd lose this 
easy and flexible option. 
Since it’s built into the Commo- 
dores, why not use it? 

The machine language pro- 
gram is situated at addresses 
$2000 to $2081. When called, 
it connects to logical file 1 and 
reads the first two bytes into ad- 
dresses $2200 and $2201. 
Those bytes are converted to 
hexadecimal and printed. 

At address $2021 we 
check to see that the last two 
digits of the load address are 
01. To do this, simply examine 
the contents of $2200. If you 
don’t find value 1 there, skip to 
the end of the program. 

Our rotary pointer is held in 
X; the value is temporarily 
stored in location $2202 when 
we read in anew byte from the 
file. The data byte is stored in 
one of three locations in the 
range $2203 to $2205. 


2027 8E 02 22 STX $2202 
202A 20 £4 FF JSR SFFE4 
202D AE 02 22 LDX $2202 
2030 9D 03 22 STA $2203,xX 
2033 £8 INX 

2034 EO 03 CPX #$03 
2036 DO 02 BNE $203A 
2038 A2 00 LOX #$00 
203A A5 90 LDA $90 
203C FO E9 BEQ $2027 


Note that ST, the status byte, 
is at $90 for Commodore com- 
puters from the VIC-20 on. 


For early PET/CBM machines, 
substitute address $96. 

Once the file is completely 
read, it's easy to examine the 
three bytes of the buffer to 
see if they're all 0. 

If the file does end with 
three O bytes, the program 
prints its ALL BASIC mes- 
sage. The loop to do this is at 
locations $204B to $2057. 

The machine language pro- 
gram disconnects from the 
file by calling Kernal subrou- 
tine $FFCC, prints a Return, 
and then passes control 
back to BASIC. 

Full coding isn't given 
here, but you can disassem- 
ble it to see the details. Note 
the changes for older PETs 
on lines 110 and 270. 


10 DATA 162,1,32,198,255,32, 

20 DATA 228,255,141,0,34,32 

30 DATA 228,255,141,1,34,169 

40 DATA 36,32,210,255,162,1 

50 DATA 189,0,34,32,96,32 

60 DATA 202,16,247,174,0,34 

70 DATA 202,208,49,142,2,34, 

80 DATA 32,228,255,174,2,34 

90 DATA 157,3,34,232,224,3 

100 DATA 208,2,162,0,165 

110 DATA 144:REM 150 FOR PET 

120 DATA 240,233,169,0,162,2 

130 DATA 29,3,34,202,16,250 

140 DATA 170,208,13,162,0 

150 DATA 189,119,32,32,210 

160 DATA 255,232,224,11,208 

170 DATA 245,32,204,255 

180 DATA 169,13,76,210,255 

190 DATA 72,74,74,74,74,32 

200 DATA 107,32,104,41,15 

210 DATA 120,248,24,105,144 

220 DATA 105,64,216,88,76,210 

230 DATA 255,32,65,76,76,32 

240 DATA 66,65,83,73,67,13 

250 FOR J=8192 TO 8321:READ X 

260 POKE J,X:T=T+X:NEXT J 

270 IF T<>14512 THEN STOP: 
REM 14518 FOR PET 

300 INPUT ‘‘NAME OF PRO- 
GRAM FILE”;F$ 

310 OPEN 15,8,15:0PEN 1,8,3,F$ 

330 INPUT#15,E,E$,E1,£2 

340 IF E<>0 THEN PRINT 
E;E$;E1;E2:END 

350 SYS 8192 

360 CLOSE 1 o 


WORLD VIEW 


Emil Heyrovsky 


VIEW FROM 
CZECHOSLOVAKIA 


Don't worry if you hear us talk- 
ing favorably about Commies 
in Czechoslovakia these 
days. The Communist party 
hasn't ruled in our country 
since November 1989. When 
we talk about Commies now, 
we're talking about our Com- 
modore computers. 

Czechoslovakia is a free 
country in the heart of Europe; 
its population slightly exceeds 
15 million, It's a mountainous 
country with a colorful history. 

Now back to the Commies. 
Thanks to the Communist re- 
gime, the value of the Czecho- 
slovak crown has fallen drasti- 
cally in comparison to its pre— 
World War II value. The pre- 
sent exchange rate is about 
30 crowns to the U.S, dollar. 

Now hold your breath. The 
average monthly salary of a 
Czechoslovak citizen today is 
2,700 crowns. That's about 
$90. During the Communist 
rule, a 64 was available only 
through special shops for al- 
most 10,000 crowns ($330). A 
1541 disk drive unit cost 
about the same amount. 

At that time, though, the av- 
erage salary was much lower, 
and the exchange rate was ab- 
surd. The only rational way to 
get a computer was to import 
it from Germany or another 
West European country. 
Thanks to bureaucratic Com- 
munist formalities, this was nev- 
er an easy process. Nowa- 
days, a 64 costs about 5000 
crowns ($165). Since it's now 
easy to travel throughout Eu- 
rope and the formalities are 
minimal, most people prefer to 
buy their 64s in Germany. 

Compared with other 8-bit- 
ters, 64s are probably the 
most widespread machines 
here; Sinclair Spectrums for- 
merly held that distinction. 
There are also some Atari, 
Sord, and Sharp computers 


around. As for 16-bit ma- 
chines, the Amiga 500 is very 
popular, as is the Atari line. 
IBM compatibles are pur- 
chased by business people, 
but Apples and Macs are sel- 
dom seen. 

Commodore software isn’t 
available in stores here. As far 
as | know, there has never 
been any means of buying soft- 
ware for our beloved comput- 
ers. As a result, 90 percent of 
all programs around here are 
pirated. 

Here’s another reason why 
pirating is so widespread: A 
standard game costs about 
750 crowns ($25), which is 
about one-third of an average 
monthly salary. Only a mad- 
man would consider buying 
software at that price. All over 
Europe there are teams of soft- 
ware crackers providing cop- 
ies of pirated software, and pro- 
grams without copy protection 
spread quickly. 

The most common way to 
get software on disk or tape, 
which is still popular here, is to 
swap programs with your 
friends. Another method is to 
pick up a bunch of disks or a 
couple of tapes and head for 
a Commodore club. There are 
two of them here in Prague, 
and trading is popular. Mem- 
bers might swap Bard's Tale 
3 for Last Ninja 3 or Boulder 
Dash for Maniac Mansion, or 
possibly buy a 1541 brochure. 
One club publishes instruction 
manuals for programs and pe- 
ripherals as well as for comput- 
ers. The club is combined 
with an Amiga group, which 
has a bad effect on weaker 
individuals, who, instead of 
squeezing bytes out of their 
64s, bounce off to Amigaland. 

Club meetings usually take 
place twice a month in a rent- 
ed hall. Some tables are put to- 
gether to form a counter for sell- 
ing books and brochures; oth- 
er tables are used for trading 
and copying. Copying is per- 
formed on 64s or 128s with 


| 
\ 
' 


disk drive units or Datasette 
tape recorders, which often 
have some kind of homemade 
adapter for smooth copying. 
Members or visitors bring 
equipment from home, since 
the club doesn't provide com- 
puters. Once a month, lec- 
tures on computer topics are 
held. Most of the people you 
meet at a club are young. 

I've noticed recently that 
the number of Commodore 
owners is slowly decreasing. 
I'll try to explain why. The 64 
and 128 are generally consid- 
ered to be affordable game ma- 
chines. A person who wants to 
do word processing or some 
other “serious” application 
thinks of buying an IBM or com- 
patible. Amigas are bought by 
wealthier game players (or se- 
rious users). Because some 
people have never learned to 
use their Commies fully, they 
don't think much of them, and 
they want to get rid of them. 

Modems are almost un- 
known here. This is due partly 
to our rotting telecommunica- 
tion system and also to public 
ignorance of electronic bulle- 
tin boards and E-mail. Moreo- 
ver, long-distance calls are 
extremely expensive. Just a 
normal chat with an overseas 
friend can swallow and digest 
your salary in a jiffy. 

Many new computer maga- 
zines are showing up on our 
newsstands, but several of 
them are just translations of 
German or other imported pub- 
lications. Unfortunately, we 
don't get COMPUTE, and 
there isn’t a good magazine 
available here that's dedicat- 
ed to the 8-bit Commodores. 
That's too bad because, as | 
said, many Commodore own- 
ers in Czechoslovakia often 
never really learn what great 
machines they have. 


Emil Heyrovsky lives in Pra- 
gue. He is the coauthor of Pad- 
lock (January 1992). a 


The 64 

and 128 remain 
popular in 
Czechoslovakia, 
along with 

tape drives, user 
groups—and 
software pirates. 


JUNE 1992 COMPUTE 


G-21 


G-22 


COMPUTE JUNE 1992 


GEOS 


Steve Vander Ark 


GRAPHIC SCRAPS 


Since desktop publishing and 
writing are what | do most with 
GEOS, | collect graphics, 
along with utilities to handle 
them as efficiently as possible. 
In earlier columns I've men- 
tioned some of the better sourc- 
es for GEOS graphics—Lamb 
Art & Design, for example— 
and suggested ways to con- 
vert graphic images from oth- 
er formats into GEOS. 

After you've collected all 
these terrific graphics, you 
still have to get them into your 
documents. Back in the Au- 
gust 1991 column | mentioned 
Scrap It, a utility which clips 
photo scraps out of geoPaint 
documents. Since many collec- 
tions of artwork for GEOS 
come in that form, Scrap It is 
essential. Other collections 
come in prepared photo al- 
bums, such as the clip art 
files from Susan Lamb (3575 
East County 18th Street, 
Yuma, Arizona 85365) and 
those from GeoWorks itself 
(GEOS Clip Art Disk, 2150 Shat- 
tuck Avenue, Berkeley, Califor- 
nia 94704). Graphics have to 
make it into photo scrap form, 
if they're going to be of any 
use, because photo scraps 
are the way GEOS moves im- 
ages between applications. 

A photo scrap is simply a 
small chunk of bitmap, the dot 
pattern that makes up a graph- 
ic image. The GEOS operat- 
ing system tags photo scraps 
as system files and handles 
them in a special way. You 
can't rename a photo scrap, 
for example, since applica- 
tions are designed to look for 
the filename PHOTO SCRAP 
when you select a tool to im- 
port a graphic into your docu- 
ment. There can be only one 
such file with that filename on 
any given disk at a time. Pho- 
to albums are collections of 
such scraps, and the key to us- 
ing photo scraps efficiently is 
to handle albums efficiently. 


The primary tool for han- 
dling photo albums is the pho- 
to manager desk accessory 
(currently in version 2.1, 
which works in 40- and 80-col- 
umn modes). Since the photo 
manager can access any of 
the photo albums on the disk, 
you use it to find the image 
you want and copy or cut it in- 
to an individual scrap. That 
scrap can then be imported us- 
ing the Edit menu functions. 

So far that's basic GEOS op- 
eration, and you've likely mas- 
tered it already. But the more 
graphics you collect, the 
more you wish for a way to ac- 
cess and organize them bet- 
ter. The photo manager per- 
forms its job admirably, but it 
can’t access scraps on anoth- 
er drive. This means your pho- 
to albums, which are tremen- 
dous disk-space eaters, must 
be specially prepared for 
each project, with only the im- 
ages you'll require, or copied 
in and out as needed. But 
then if you want to create an 
album of only the clips you're 
likely to need, there's no easy 
way to move them from one al- 
bum to another without open- 
ing and closing each album to 
make a transfer. 

Now if you've read this col- 
umn before, you know that | on- 
ly pose dilemmas if | have a so- 
lution in mind. In the case of 
photo scraps, there are sever- 
al excellent utilities available 
which can make all this shuf- 
fling of graphics a breeze. The 
program AlbumCopy by Mi- 
chael Myers presents you 
with a control panel which al- 
lows you to select source and 
destination albums and then 
flip through the clips to 
choose which ones you'd like 
to transfer. It can't get much 
easier than that! To download 
it from Q-Link, request AL- 
BUMCOPY, which was upload- 
ed by GeoLib PH. 

This utility is also handy for 
reducing the size of any over- 
size photo albums you've creat- 


ed with earlier versions of 
GEOS that the GEOS 2.0 pho- 
to manager can't handle. This 
happens because the version 
2.0 albums hold only half as 
many clips as those of the old- 
er model—60 as compared to 
120. If you'd rather just revert 
to the old version so you can 
work with the old photo man- 
ager, get a copy of Album 
Reverter, written by Joe Buck- 
ley (ALBREV.SFX on Q-Link, 
uploaded by Red Storm). This 
utility reverses the update proc- 
ess that the new photo manag- 
er automatically performs 
when you try to open an older- 
style album. 

But the single most helpful 
program you can get for using 
photo scraps comes in two in- 
carnations, one a desk acces- 
sory and the other an applica- 
tion. Scrapgrab, the desk ac- 
cessory version, lets you se- 
lect a photo from an album or 
ascrap on a disk in a different 
drive. The application version, 
identical except that it handles 
larger scraps, is called Pho- 
tograb. To download from Q- 
Link, look for SCRAPGRAB 
and PHOTOGRAB. GeoLib 
PH uploaded both of these. 

With these utilities you can 
finally keep your photo collec- 
tion where it belongs—on a 
graphics collection disk—and 
access your clip art when you 
need it from within geoPublish 
or other applications without 
those albums taking up every 
inch of disk space on your 
main work disk. The addition 
of these two files will let you ef- 
fortlessly use your clip art, not 
be strapped down by it. 

Imagine a disk of photo al- 
bums, all sorted into catego- 
ries, which you can access, 
browse through, and select 
from at will as you geoPublish 
along. You'll never again have 
to drop out of your document 
to track down a graphic when 
you keep your graphics on a 
library disk and Scrapgrab on 
your work disk. Oo 


The Gazette 
Productivity 9 
Manager <> 


(Formerly PowerPak) 


Harness the productivity 
power of your 64 or 128! 


Turn your Commodore into 

a powerful workhorse, keep track 
of finances, generate reports 
in a snap, Manage your 
money in minutes— 

all with the new 1991 
Gazette Productivity 
Manager! Look at all 
your 64/128 Productivity 
Manager disk contains. 


ORDER YOUR 
1991 GAZETTE 
PRODUCTIVITY 
MANAGER 
TODAY! 


GemCalc 64 & 128— 

A complete, powerful, user- 

friendly spreadsheet with all 
the features you'd expect 
in an expensive commercial package 
(separate 64 and 128 versions are included). 
Most commands can be performed with a single keypress! 


Memo Card—Unleashes the power of a full-blown 
database without the fuss! Nothing’s easier—it’s a 
truly simple computerized address file. Just type in 
your data on any one of the index cards. Need to edit? 


Just use the standard Commodore editing keys. (MasterCard and Visa accepted on orders with subtotal over $20). 
Finished? Just save the data to floppy. What could be jf 
easier? DYES! Please send me Productivity Manager disk(s) 


($14.95 each). 

Subtotal 

Sales Tax (Residents of NC and NY please add appro- 
priate sales tax for your area. Canadian orders, add 
7% goods and services tax.) 

—— Shipping and Handling ($2.00 U.S. and Canada, $3.00 
surface mail, $5.00 airmail per disk.) 

—— Total Enclosed 

—Check or Money Order -_ MasterCard ~— VISA 


Financial Planner—Answers all of those questions 
concerning interest, investments, and money manage- 
ment that financial analysts charge big bucks for! You 
can plan for your children’s education and know 
exactly how much it will cost and how much you need 
to save every month to reach your goal. Or, decide 
whether to buy or lease a new car. Use the compound 
interest and savings function to arrive at accurate 


Credit Card No. 


estimates of how your money will work for you. ee (Required) 
Compute the answer at the click of a key! Sarita & 

Address 
DON’T MISS OUT ON THIS | =: Tce 


Send your order to Gazette 1991 Productivity Manager, 
324 W. Wendover Ave., Ste. 200, Greensboro, NC 27408. 


POWERFUL WORKHORSE! 


| 


| 
| 
| 
| 
| 
| 
| 
| 
I 
i 
i 
| 
| 
1 Signature 
| 
! 
| 
| 
| 
| 
| 
| 
| 
| 
I 
| 


PROGRAMMER’S PAGE 


Randy Thompson 


POKE, WAIT, AND SYS 


Use this handy reference sheet when 
you want to get your hands dirty muck- 
ing around in your 64’s RAM, interro- 
gating and manipulating memory, and 
making unconventional (and often un- 
authorized) direct calls to ROM. 

Some commands will not work in im- 
mediate mode and must be run from 
within a program. Tips with an asterisk 
have been known to cause side ef- 
fects—but sometimes you need to 
break a few rules to get the job done. 

WAIT is probably the least utilized of 
these three commands, so |'ll use the 
rest of this column for a mini lesson in 
its use. WAIT halts the execution of a 
BASIC program until the contents of the 
memory address meet the conditions 
specified. 

What all this means is that WAIT is a 
great statement to simplify key fetches 
and delays. Here are a few ways it can 
be used in your programs. 


10 WAIT 198,15:GET A$ 
This line waits for a key to be pressed. 


10 WAIT 197,63:KEY=PEEK(197) 
20 WAIT 197,64 


Line 10 waits for a key to be pressed, 
and line 20 waits for it to be released. 


10 WAIT 653,1 
20 WAIT 643,1,1 


Line 10 waits for Shift to be pressed, 
and line 20 waits for it to be released. 
Change the 1 in each line to 2, and the 
program waits for the press and re- 
lease of the Commodore key. Substi- 
tute a 4 to wait for the Ctrl key. 
Contributors to this list of coding voo- 
doo are Michael Hall of De Soto, Tex- 
as; Jerry Krebs of Taylor, Texas; Stacy 
Olivas of Graham, Washington; and He- 
len Roth of Los Angeles, California. 


“Programmer's Page” is interested in 
your programming tips and tricks. 
Send them to Programmer's Page, 
COMPUTE's Gazette, 324 West Wen- 
dover Avenue, Suite 200, Greensboro, 
North Carolina 27408. We'll pay $25- 
$50 for each tip we publish. a 


G-24 COMPUTE JUNE 1992 


Screen Command 
POKE 646,C 
POKE 53280,C 
POKE 53281,C 
POKE 53272,21 
POKE 53272,23 


POKE 53265,PEEK(53265) AND 239 


POKE 53265,PEEK(53265) OR 16 
POKE 211,C 

POKE 214,R 

SYS 59296 

SYS 58726 

SYS 59516 

SYS 59626 

SYS 59848 

SYS 59749 


Keyboard Command 
POKE 198,0 

POKE 650,128 

POKE 650,127 

POKE 650,0 


POKE 649,1 

POKE 649,0 

POKE 649,10 

POKE 808,239 

POKE 792,193 

POKE 808,234 

POKE 808,237:POKE 792,71 
WAIT 653,1 

WAIT 653,2 

WAIT 653,4 


BASIC Command 
POKE 818,32 
POKE 818,237 
POKE 775,200 
POKE 775,167 
POKE 774,0 
POKE 774,24 
POKE 204,0 
POKE 204,255 
POKE 19,65 
POKE 19,0 


System Command 
SYS 58266 
SYS 65126 
SYS 64738 


Miscellaneous Command 
POKE 56325,R 

POKE 54296, 15:POKE 54296,0 
WAIT 56320, 16,16 

WAIT 56321,16,16 

SYS 62913 


Function 

changes cursor color (0-15) 
changes border color (0-15) 
changes background color (0-15) 
switches to uppercase mode 
switches to lowercase mode 

turns off the screen display 

turns on the screen display 

moves cursor to specified column (0-79) 
moves cursor to specified row (0-24) 
Clears the screen and prints READY 
homes the cursor 

moves the cursor down 

scrolls the screen up 

scrolls the screen down" 

inserts a line 


Function 

clears keyboard buffer 

enables autorepeat for all keys 

disables autorepeat for all keys 

enables autorepeat for only the cursor keys, 
space bar, and Inst/Del key (computer's default) 
disables keyboard buffer 

disables keyboard 

returns keyboard to normal 

disables Run/Stop key” 

disables Restore key 

disables Run/Stop-Restore and LIST* 
reenables Run/Stop-Restore and LIST 

waits for Shift to be pressed 

waits for Commodore key to be pressed 
waits for Ctrl to be pressed 


Function 

disables SAVE 

enables SAVE 

disables LIST 

enables LIST 

prevents line numbers from listing 
resurrects lines numbers 

turns on cursor during GET* 

turns off cursor during GET 

turns off question mark during INPUT* 
turns on question mark during INPUT 


Function 

prints startup message and erases BASIC program 
warm reboot (erases screen) 

cold reboot (erases program) 


Function 

changes cursor blink rate (0-255, 58 is normal) 
makes a click sound 

waits for fire button of joystick in port 2 to be pressed 
waits for fire button of joystick in port 1 to be pressed 
prints the name of the latest loaded or opened file 


PROGRAMS 


FILE LOGGER 


By Roger Bachelder 

File Logger is a short two-part program 
that will list all the files that you have on a 
disk. It presents you with the disk’s BAM 
title, the disk ID, and each file's starting 
track and sector. File Logger's unique fea- 
ture is that italso gives you each file's start- 
ing and ending address. 


Typing It In 
The first part of File Logger is written en- 
tirely in BASIC. To help avoid typing 
errors, use The Automatic Proofreader 
to enter the program. See ‘Typing 
Aids” elsewhere in this section. After en- 
tering the first part of the program, be 
sure to save it to disk before exiting. 
The second part of File Logger is writ- 
ten in machine language. Use MLX 
our machine language entry program, 
to type it in. Again, see “Typing Aids.” 
When MLX prompts, respond with the 
following values. 


Starting address: GAAO 
Ending address: 6E07 


Save this machine language program 
as LOG.ML on the same disk as the BA- 
SIC program. File Logger will automat- 
ically load and run LOG.ML, so be 
sure to save it with this filename. 


Reading Disks 
After the program runs, you'll see a 
menu giving you the option to LOG 
DISK or EXIT TO BASIC. Insert the 
disk you want to check and enter 1. 
You'll then be asked whether or not 
you want the output sent to a printer. 
File Logger will then read the direc- 
tory and present you with the disk 
name, ID, file type, track, sector, and 
blocks. It will then ask you if you want 
to see the starting and ending address- 
es. It prints this information in hexadec- 
imal notation. 


FILE LOGGER 


HE 10 IFPEEK(83@)=1THEN720 

CQ 15 IFPEEK (27296) <>169THENLO 
AD"LOG.ML",8,1 
POKE8@8, 225: POKE146,0 
POKE 53281,6:POKE53280,6 
:CLR 

DIMFS (10G) :TP$(@) ="XXX": 
TP$(2)="PRG":TPS$ (1) ="SEQ 
" 


17 
20 


QJ 
xs 


JR 25 


HG 


QD 
RH 


RA 
JE 
DH 
DQ 
AJ 


cD 


PH 


FI 


GP 


36 


56 


TPS (3) ="USR":TPS (4) ="REL 


H$="@123456789ABCDEEF" 
PRINTCHRS (142) ;"{CLR} 
{DOWN} {BLK} (C) 1992 CoM 
PUTE PUBLICATIONS INTL L 
inp™ 

PRINT"{1@ SPACES}ALL RIG 
HTS RESERVED" 

PRINT" {DOWN} {WHT} 

{9 SPACES}F ILE 

{3 SPACES}L 0 GG E R" 
PRINT"{3 SPACES}{35 T}" 
PRINT" {DOWN}{28 SPACES}" 
PRINT"{3 DOWN} 1 -~ 
{YEL}LOG DISK" 


160 PRINT"{DOWN} {WHT} 2 ~~ 


126 


136 
146 
156 


176 
186 


196 
260 


216 


226 
2390 


246 
250 
266 
276 
275 
280 


2998 
295 


360 


365 


316 


{SPACE}{YEL}EXIT TO BAS 
fel] 

PRINT"{2 DOWN} {WHT} PLEA 
SE SELECT (1 - 2):";:PO 
KE204,0 

GETAS 

IFAS="1"THEN189 
IFAS="2"THENPOKE204,1:P 
RINTAS:END 

GOTO136 

PRINT"{CLR}{5 DOWN} 
{WHT} SEND OUTPUT TO PR 
INTER (Y/N) 2"; 2POKE204, 
GETAS 
IFAS="Y"THENPOKE204,1:P 
RINTAS$: Z=4:GOTO230 
IFAS="N"THENPOKE 204 ,1:P 
RINTAS: Z=3:GOTO23G 
GOTO190 

PRINT" {CLR}{4 DOWN} 
{WHT}LOOKING AT DIRECTO 
RY...";:BMS=""sOPEN15,8 
715,"I":0PEN3,8,3,"S" 
CLOSE4:OPEN4,Z:DN=Z-3:T 
B=10*DN 
FORX=1T0142:GET#3,A$:NE 
XT: PRINT". "3 
FORX=1T016:GET#3,B$:BMS 
=BMS+BS$:NEXT: PRINT". "; 
GET#3,A$,A$:GET#3,I1$,1 
2$ 
IFZ=4THENPRINT#4 ,CHRS (1 
3) CHRS (13) 

PRINT" {CLR}"; :PRINT#4,T 
AB(TB);"{8 SPACES}BAM T 
ITLE{13 SPACES}ID" 
IFZ=3THENPRINT" {WHT} 

{8 SPACES}{24 T}" 
IFZ=4THENPRINT#4,TAB (TB 
);"{8 SPACES}---------- 


1$+12$: PRINT" {WHT } 
";:PRINT#4,TAB(TB) ;" 

{8 SPACES}";:PRINT#4,BM 
$;"{6 SPACES}";IDS 
IFZ=4THENPRINT#4 ,CHRS (1 
3) ;CHRS$ (13) 

PRINT" {2 DOWN} {WHT}";:P 
RINT#4,TAB(TB) 7" 

{3 SPACES}TRK SEC BLKS 


KA 


SP 


BG 


BS 


PJ 


MR 


JH 


DX 


KR 


326 


325 


336 
348 
358 
366 
376 
386 


396 


406 
416 


420 


436 
446 
456 
466 
479 
480 


499 
5008 


516 
520 


536 
540 
550 
569 


578 
586 


599 
600 
619 
629 


630 


{4 SPACES}FILENAME 

{5 SPACES}TYPE" 
IFZ=3THENPRINT" {WHT } 

{3 SPACES}{33 T}" 
IFZ=4THENPRINT#4, TAB (TB 
);"{3 SPACES}- 


FORJ=1T092:GET#3,A$:NEX 
TJ 
M=M+1:GET#3,K$,TS,SS$:1F 


s$ 
FS =1T016:GET#3, 
AS:FS=FS+A$:NEXTI 
FORJ=1T016:GET#3,A$:NEX 
TJ 
L=0:IFAS<>""THENL=ASC (A 
$) 
PRINT#4,TAB(TB) ;" 
{3 SPACES}";:PRINT" 
{WHT }"; 
LS$=RIGHTS (STR$(L) ,2) : IF 
LEFTS$(LS$,1)="_"THENLS=" 
"+RIGHTS (LS, 1) 
IFASC (T$+CHR$ (@) ) =OTHEN 
IFL=GTHEN560 
TS=RIGHTS (STRS (ASC (TS) ) 
,2):IELEFTS$(T$,1)="_ "TH 
ENTS="9"+RIGHTS (T$,1) 
S$=RIGHTS (STR$ (ASC (S$) ) 
12): IFLEFT$(S$,1)="_ "TH 
ENSS="6"+RIGHTS (S$,1) 
K=ASC (K$+CHRS (8) ) ~128 
IFK<10RK>5THENK=9 
PRINT#4,TS$;"{2 SPACES}" 
7? PRINT" {WHT}"; 
PRINT#4,S$;"{2 SPACES}" 
7 PRINT" {WHT}"; 
PRINT#4,L$;"{3 SPACES}" 
}:PRINT"{WHT}"; 
K$=TP$(K) : PRINT#4,FS;" 
{SPACE}";:PRINT" {WHT }"; 
IFK=OTHENPRINT" {WHT }"; 
PRINT#4,KS: IFK<>2THEN52 
6 
FS$(Q)=F$:Q=Q+1 
GET#3,A$: IFM<8THENGET #3 
7AS,A$:GOTO54G 
M=0 - 
IFST=OTHEN340 
CLOSE3 
PRINT: PRINT" {DOWN} {YEL} 
DISPLAY {WHT}START 
{YEL}& {WHT}END {YEL}AD 
DRESSES ({WHT}Y{YEL}/ 
{WHT }N{YEL}) {WHT}:";:PO 
KE264,0 
GETAS 
IFAS="Y"THENPOKE204,1:P 
RINTAS:GOTO618 
IFAS="N"THENPOKE204,1:P 
RINTAS: POKE83@,0:GOSUB9 
60:RUN 
GOTO578 
SYS27296 
PRINT #4,CHR$ (13) ;CHRS(1 
3) : PRINT" {CLR}" 
CLOSE3:X=-1 


JUNE 1992 COMPUTE G-25 


PROGRAMS 


AX 646 PRINT"{WHT}";:PRINT#4,T | 6B46:16 6C C9 A7 AD 16 6C E9 SE | 6D76:60 1C 60 GG 26 4G 6G AD CA 

AB(TB);"{5 SPACES}FILEN | 6B48:64 90 CC A9 62 AG G3 8D OF | 6N78:12 A2 G1 26 32 G3 36 SA 7F 

AME{9 SPACES}START 6B56:0F 6C 8C 16 6C AY 45 26 11 | 6D8G:A9 G2 85 BA AB BO BO B6 34 

{3 SPACES}END" 6B58:E7 6B 20 AE FF 78 AD @@ 2A | 6D88:29 87 C9 82 DO 21 AE 96 3A 

CK 645 IFZ=4THENPRINT#4,TAB(TB ID 29 63 85 11 89 26 8D A3 | 6D90:64 BD 97 64 D9 G3 G6 FO E7 

7"{5 SPACES}- 6B68:06 DD 2C 6@ DD 76 FB 18 FC | 6D98:98 C9 2A FG 23 C9 3F DB CD 

6B70:AD 11 D@ 29 67 69 2F 8D D8 

CA 650 IFZ=3THENPRINT" {WHT 6B78:24 6C AS OG 8D 15 DG 85 99 
{5 SPACES}{29 T}" 

FE 669 X=X+1l:IFFS$(X)=""THENPOK 

E830,8:GOSUB9@0G: RUN 6DCG:A4 GA C8 8C 5G G1 DG G3 7D 

RC 67@ PRINT" {WHT}";:PRINT#4,T 6DC8:29 88 03 BE G1 G6 B9 66 BS 

AB(TB);"{5 SPACES}";FS( | 6BA@:B9 D@ G4 AG C3 A4 C4 86 34 | 6DDG:G6 FO 11 36 GF 26 32 G3 76 


C8 E8 EC 95 64 99 ED 68 
A® D9 G3 G6 FO 11 18 1A 
GA 69 26 96 CC AE 61 26 
AD 66 66 D@ BD FO 1A DB 


xX) p" "3 6BA8:AE 84 AF A2 G3 AG OG E8 9B | 6DD8:1G EE 8C 5G G1 AQ FF 8D 4A 
DC 680 FORV=16TO1STEP~1:PS$=MID | 6BBG:BD 60 6E Bl AE E6 AE DO BE | 6DEG:G0 66 30 E4 AQ 12 26 D1 39 

$(E$(X) ,V,1) 6BB8:02 E6 AF EC Gl 6E 96 EF El | 6DE8:03 AO G1 4C 69 FO G8 BO D7 
PC 694 IFPS=CHR$(160)THENNEXTY | 6BC@:AD 90 6E DG BC 20 D4 6B C4 | GDFG:31 39 39 31 26 4c 4F 47 65 
KH 706 FS=LEFTS (FS (X) ,V) 6BC8:98 30 G6 A6 AE A4 AF 18 A2 | 6DF8:2D 4D 2F 4C AG AG AG AG D1 
JF 710 POKE830,1:LOADF$,8,1 6BDG:60 4C 30 F5 AD 12 6C 85 64 | 6EGG:F6 BG G6 GO BG GO GO BG 5B 


GP 72G A=PEEK (828) :B=PEEK (829) | 6BD8:11 AD 13 6C 8D G6 DD AD A2 


AH 730 PRINT"{WHT}"; :GOSUB78G pa ee Roger Bachelder does his program- 
XC 740 PRINT#4,"{2 SPACES}"; 3 


7 ming in Salem, Oregon. 
JH 750 A=PEER(175):B=PEEK(174) | SBF 9:90 30 13 A9 FR 20 93 FF CO 2 7 


6BF8:AG OG BY GC 6C 20 AB FF 4D 
EF 760 PRINT" {WHT}"; :GOSUB786 % 
SB 77@ PRINT#4:GOTO66G 6COG:C8 CH G6 98 F5 60 20 D4 7D 


6C08:6B 4C 67 F7 4D 2D 45 62 BS 
Se ea racar ey thctay | Sete! DEMO MAKER 
90:W=B:GOSUB790: RETURN 6C16:93 26 66 97 GB 2C BB DD 7A 


6C18:58 FB AG G8 38 A6 11 EA 95 
Ee OOO END ale) RaW de Le 6C20:AD 12 Dd £9 32 90 a4 29 12 | BY Danny English , 
XA 800 AS=MIDS$(H$,J+1,1):BS=MI | ¢099:97 FG F5 GE GO DD ga go Fp | Cleating acolorful, eye-catching demon- 
DS (HS,I+1,1) 6C30:20 AA EA EA 24 80 AD @@ 4g | Stration can be a difficult task, butit's a 
ze aan ERNIE PAG BE RETURN 6C38:DD 4A 4A EA 4D 06 DD 4a Fa | snap with Demo Maker. You can create 
2 6C40:4A EA EA EA 4D @@ DD 4A 75 i i 
PC 905 PRINT" {HOME}{23 DOWN} 6C48:4A 45 11 4D G6 DD 8E G6 23 BS Soe oe en matertontl, 
{BLU}{7 SPACES}PRESS AN | 6C5@:DD EA 99 @@ 6E C8 DG C4 G3 y P rd peters 
Y KEY TO CONTINUE" 6C58:60 FO 3F A9 G8 8D ad 18 az | 2 Key. When you save your finished de- 
SB 910 FORDE=1T0100:GETAS:IFAS | 6c6G:A2 G1 AS 22 DG G2 A9 12 95 | MOON disk, itcan be loaded and run like 
<>""THEN95@ 6C68:85 66 86 67 AD BG 26 25 3c | aBASIC program. 
ae aoe SEC HOMEN to CONN) 6C70:03 AX EG 29 25 63 C9 G2 1E You can use Demo Maker as a loader 
6C78:B@ F2 8D GO 18 6G A2 GO OF | withi i . 
{WHT}{7 SPACES}PRESS AN | 6C80:86 F9 8D 98 62 9D 5B G2 95 a ea aeNe Sele eae 
Y KEY TO CONTINUE" 6C88:4C C6 D5 85 G6 86 B7 18 BC Pre Ory L 
CH 94@ FORDE=1T0100:GETAS:IFAS | 6C96:68 69 G1 8D 76 G3 68 BD GF | aN exciting title to your own creation. The 
<>""DHEN95B 6C98:77 63 AS G6 20 D1 63 ad Fa | Vivid raster display will add luster to the 
FR 945 NEXT 6CAG:G6 85 31 26 GA F5 56 FE CD | dullest program. 
GF 946 GOTO905 6CA8:B8 AD G1 1C 91 30 C8 DG DA 
CD 950 RETURN SCBO:F5 AG BA 56 FE BB AD Ol 40 | Typing It In 
SCBB:1C 99 BG G1 C8 DG F4 20 A | Demo Maker consists of two programs 
LOG.ML 6CCO:EO FB 20 £9 FS C5 3a FO 17 | [OMe eneIs pICgl ape: 
b 6CC8:05 A9 GS 4C 69 F9 4c 1E DD he first part is written entirely in ma- 


6AAG:A9 CB 8D 36 G3 AY 6A 8D 5G | 6CDG:04 GBF 87 BD G5 GB G3 69 84 | chine language. You must enter this pro- 
6AA8:31 63 60 86 GG AD AS 2 62 | 6CD8:41 GE 66 GC G4 BA G2 BB 8B | gram with MLX, our machine language 
6ABG:30 63 AY F4 8D 31 63 60 7A | 6CEG:00 20 C5 G3 AG BG BO BO 23 “Topi ‘del i 
6AB8:00 8C 3C G3 BE 3D 63 69 38 | 6CE8:06 4A 4A 4A 4A 48 BO BO 2C SU aU Se Fe - 
6ACG:85 93 A8 DG 13 8C EF 6D 77 | 6CFG:06 29 GF AA BD 78 G3 AA 24 A 

6AC8:B1 BB C9 24 FG BA AG BA 98 | 6CF8:A9 G1 8D GG 18 2c ad 18 22 | Prompts you, respond with the values 
6ADG:EG G8 96 G4 EG GC 96 G5 C7 | 6DGG:DG FB 8E 6G 18 8A GBA 29 3c | given below. 

6AD8:A5 93 4C AS F4 Bl BB 99 C8 | 6D68:0F 8D 6G 18 68 AA BD 78 31 
6AEG:F@ 6D C8 C9 3A DG G3 8C EG | 6D1G:03 8D BG 18 GA 29 OF EA 4F | Starting address: 3F7B 
6AE8:EF 6D C4 B7 90 EF 8C EE 71 | 6D18:8D 00 18 C8 DG C8 AD 8 4E | Ending address: 4A7A 
6AF@:6D 20 AF F5 AS 1l 8D 12 78 | 6D2:8D 9G 18 4D GG 1C 8D G@ 25 b 
6AF8:6C AD G@ DD 8D 13 6C AD 8C | 6D28:1C 66 38 85 96 E5 22 FO 85 Mier) cb y 
6B@G:15 DS 8D 14 6C A9 59 AG E5 | 6D30:41 49 FF 18 69 G1 6A AE 91 | When you've finished typing, be sure 
6B08:6C 85 AE 84 AF A9 GG AG 59 | 6D38:9G 1C A8 36 G3 CA 88 2C B2 | to save the program to disk with the 
6B10:03 8D OF 6C 8C 18 6C AD a oe gs Be a Bs mm an AD He name DEMO.CODE. The second part 
6B18:57 26 E7 6B AG OG Bl AE 6D | 6D48: é : 

6B20:20 A8 FF C8 CB 2G 96 F6 5C | 6D5G:1C AQ BF 8D O5 18 2C G5 54 a rat Maker will load this program 
6B28:20 AE FF 18 98 65 AE 85 79 | 6D58:18 30 FB 98 D@ D9 A5 6 93 y inatname. oe ee 
6B3G:AE 96 G3 E6 AF 18 98 6D CD | 6D60:85 22 20 4B F2 85 43 AD 21 Demo Maker's editor is written en- 
6B38:0F 6C 8D GF 6C 96 G3 EE EE | 6D68:06 1C 29 9F 1D 1A @4 8D S@ | tirelyin BASIC. To help avoid typing er- 


G-26 COMPUTE JUNE 1992 


rors, use The Automatic Proofreader to 
enter this program. See “Typing Aids” 
again. 


Raster Magic 

When both programs are saved on 
disk, load the BASIC Demo Maker and 
type RUN. The demo code will be load- 
ed, followed by the menu screen. 

Creating a demo with the editor is 
very simple. Use the cursor keys to 
move the pointer up and down the op- 
tions. To change colors, move the point- 
er to the color you wish to change and 
press the + or - keys. The colors will cy- 
cle forward or backward to the color 
you desire. 

The raster colors are all coded by 
shades. For example, shades of red in- 
clude brown, pink, and orange. 
Shades of yellow are actually a rain- 
bow of colors. For effect, the large 
scrolling raster is split in half, allowing 
two shades to be seen at once. 


Text Options 

The demo screen has a scrolling text 
display in the lower screen, fading or 
flashing text in the middle, and large ti- 
tle text at the top. There are options on 
the menu to edit all of these. To select 
one of the options, move the pointer 
and press Return. 

Because of the way the text is 
stored, a special text-entry routine is 
used that doesn’t allow you to use the 
cursor keys. You simply type from left 
to right, however, and the cursor will 
wrap around normally. The Delete key 
does work in its normal fashion. Press 
Return when you've finished entering, 
and the text will be stored in the demo. 

The large title letters were created us- 
ing a special character set. This char- 
acter set doesn’t contain punctuation 
marks or numbers; therefore, use only 
letters A to Z when entering the title. 

In the center of the screen is a 
large section of text that's fading or 
flashing. The menu has options to con- 
trol the color and speed of the fading. 
Notice that the top and bottom lines of 
this text appear on rasters in the demo. 
The color of these lines is specified in 
the menu by the text on raster color. 


Saving the Demo 
You can preview your demo at any 
time by pressing the space bar. Press- 


ing the space bar again will return to 
the menu. When the demo looks the 
way you want it, move the pointer to 
the save option and press Return. 
You'll then be asked if it should boot an- 
other file. If you enter Y, you'll be 
prompted for the filename and SYS ad- 
dress if it's a machine language pro- 
gram. If you enter N, the program will 
tell the demo to return to BASIC after 
viewing. 

The next prompt is the filename for 
the actual demo. Saving the program 
takes more than a minute, but then it 
can be loaded and run like a BASIC pro- 
gram. If the demo is to boot another 
file, be sure to save it on the same 
disk. After watching the demo, press 
the space bar to continue. 

Feel free to experiment with color 
combinations and creative text dis- 
plays. Whether you're making the title 
to a game or just an attractive display, 
Demo Maker will amaze you. 


DEMO.CODE ; should be OB 


3F7B:08 6B 9E 32 36 
3F83:36 34 
3F8B:EA EBA 
3F93:EA EA 
3F9B:EA EA 
3FA3:18 
3FAB:25 
3FB3: 26 
3FBB:A9 
3FC3:AG 
3ECB:FB 
3FD3:E4 
3FDB:E4 
3FE3:E4 
3FEB:DG 
3PF3:85 
3FFB:85 
4003: 20 
400B: 20 
4013:20 
401B:20 
4023:20 
402B:13 
4933:13 
463B:09 
4043:12 
464B:6D 
4053: 20 
405B:20 
4063:20 
406B: 20 
4073:28 
407B:26 
4083:63 
408B: 20 
4993:18 
409B:13 
40A3:20 
40AB: 20 


68 
OG 
EA 
EA 
EA 
78 


4GB3:26 
4G0BB:26 
46C3:26 
46CB: 2G 
49D3:14 
4GDB: 26 
4GE3:14 
4GEB:G5 
4GF3:20 
4GFB:20 
4163:26 
416B:26 
4113:26 
411B:26 
4123:12 
412B:290 
4133:909 
413B:20 
4143:2G6 
414B:20 
4153:2G 
415B:26 
4163:290 
416B:05 
4173:69 
417B:GF 
4183:61 
418B:06 
4193:26 
419B: 26 
41A3:29 
41AB:26 
41B3:26 
41BB:2¢ 
41C3:26 
41CB: 26 
41D3:298 
41DB: 20 
41E3:05 
41EB:05 
41F3:61 
41FB:GE 
4263:14 
420B:6F 
4213:26 
421B:2E 
4223:61 
422B:6D 
4233:13 
423B:GE 
4243:26 
424B:68 
4253:0D 
425B:15 
4263:26 
426B:26 
4273:GF 
427B:65 
4283:0C 
428B:99 
42933290 
429B:14 
42A3:0C 
42AB:14 
42B3:0C 
42BB: G2 
42C3:61 
42CB: GF 
42D3:05 
42DB:14 


16 


JUNE 1992 COMPUTE G-27 


PROGRAMS 


42B3:14 
42EB:05 
42F3:10 
42FB:09 
4303:05 
436B:13 
4313:61 
431B:07 
4323:16 
432B:20 
4333:2E 
433B:08 
4343:14 
434B:6D 
4353:26 
435B:GE 
4363:13 
436B:20 
4373:1F 
437B:76 
4383:78 
438B:70 
4393:78 
439B:78 
43A3:78 
43AB:78 
43B3:03 
43BB:06 
43C3:78 
43CB:78 
43D3:7C 
43DB:7C 
43E3:78 
43EB:76 
43F3:78 
43FB:76 
4463:78 
440B:83 
4413:78 
441B:78 
4423:76 
442B:38 
4433:38 
443B:86 
4443:FG 
444B:3E 
4453:3C 
445B:1C 
4463:62 
446B:62 
4473:3C 
447B:3C 
4483:CG 
448B:78 
4493:38 
449B:06 
44A3:7C 
44AB:1C 
44B3:3C 
44BB:3C 
44C3:3C 
44CB:3C 
44D3:3C 
44DB:82 
44E3:1C 
44EB:1C 
44F3:1C 
44FB:38 
4503:38 
456B:3C 


G-28 


78 


FG 


COMPUTE 


E@ CO FG 
JUNE 1992 


4523:70 
452B:76 


45DB:3C 
45E3:1E 
45EB:GE 
45F3:1C 
45FB:GE 
4663:00 
460B:86 
4613:1C 


4633:78 
463B:06 
4643:1C 
464B:1C 


esssnoanasnana 


46BB:1D 
46C3:16 
46CB:A2 
46D3:D8 
46DB: 36 
46E3:47 
46EB:B9 
46F3:26 
46FB:EF 
4763:4D 
476B:47 
4713:47 
471B:CD 
4723:20 
472B:B9 
4733:306 
473B:DC 


4743:4C 
474B:DG 
4753:15 
475B:68 
4763:095 
476B:6F 
4773:GF 
477B:88 
4783:08 
478B:G3 
4793:6C 
479B:90 
47A3:65 
47AB:43 
47B3:54 
47BB:4F 
47C3:45 
47CB:52 
47D3:CD 
47DB:C7 
47E3:07 
47EB:F5 
47F3:69 
47FB:FF 
4863:69 
480B:85 
4813:A5 
481B:4C 
4823:04 
482B:69 
4833:9D 
483B:D0 
4843247 
484B:67 
4853:18 
485B:49 
4863:C9 
486B:D5 
4873:CG 
487B:58 
4883:AG 
488B:C8 
4893:99 
489B:28 
48A3:FG 
48AB:F1 
48B3:AD 
48BB:A9 
48C3:CF 
48CB:Al 
48D3:F3 
48DB:61 
48E3:F2 
48EB:47 
48F3:608 
48FB:8D 
4963:CE 
490B:C7 
4913:CF 
491B:08 
4923:B9 
492B:45 
4933:E3 
493B:C8 
4943:DG 
494B:8D 
4953:14 
495B:1A 
4963:bDG 
496B:8D 


8D 
c8 
De 
62 
6B 
G1 
gc 
G9 
OA 
63 
Ol 
62 
20 
45 
26 
55 
26 
c4 
BF 
47 
07 
Bl 
85 
97 
FE 
A2 
26 
38 
46 
78 
E8 
Ur) 
De 
E9 
9D 
G4 
E8 
oo 
F8 
co 
68 
DG 
99 
66 
9D 
91 
cg 
Fl 
8D 
61 
F3 
1) 
61 
47 
8D 
6a 
c8 
47 
oo 
46 
99 
36 
Ag 
Deo 
8D 
AG 
a5, 
78 
8D 
Ag 


4973:29 
497B:00 
4983:02 
498B:FD 
4993:00 
499B:CO 
49A3:A9 
49AB:D2 
49B3:00 
49BB: 40 
49C3:2F 
49CB:41 
49D3:20 
49DB:AD 
4963247 
49EB:86 
49F3:CF 
49FB:F3 
4A93:20 
4RGB:C9 
4A13:93 
4A1B:AD 
4A23:20 
4A2B:2A 
4A33:2A 
4A3B:00 
4043340 
4A4B: 68 
4A53:FF 
4A5B:4C 
4A63:A9 
4A6B:79 
4A73:04 


5B 
4c 
A2 
De 
99 
60 
G2 
26 
AG 
B9 
EF 
48 
oo 
6D 
AG 
ag 
8D 
49 
CA 
26 
Ag 
62 
B8 
2A 
2A 
AQ 
FF 
BA 
cg 
52 
G2 
8D 
Cl) 


FF 
4D 
Cy) 
F8 
A7 
26 
AQ 
D2 
CT) 
EF 
DO 
AD 
26 
48 
41 
66 
F2 
20 
48 
5E 
ao 
Do 
G2 
2A 
2A 
19 
AQ 
FF 
O1 
8D 
Ag 
7A 
06 


58 
47 
CA 
6a 
G2 
LS 
93 
FF 
B9 
40 
EF 
oF 
83 
AD 
A2 
8D 
CF 
CF 
AS 
49 
85 
G1 
G2 
2A 
2A 
A2 
Uy) 
26 
FG 
Teh 
4E 
82 
Ui) 


FS 
23 
F2 
99 
96 
13 
63 
53 
Dl 
D4 
Wi 
BS 
08 
DE 
69 
6B 
72 
5A 
23 
53 
F2 
6c 
56 
BE 
47 
oF 
DL 
1A 
54 
82 
3c 
47 
4A 


DEMO MAKER 
BA 10 REM COPYRIGHT 1992 COMPU 


SA 


HD 
ss 


CG 
PD 
AA 
RF 


KS 


RD 


PH 


QE 


AE 


CE 


26 


36 
4G 


50 
66 
76 
86 


90 


126 


136 


146 


TE PUBLICATIONS INTL LTD 
- ALL RIGHTS RESERVED 
IF A=@ THEN A=1:LOAD"DEM 

0.CODE",8,1 

DIM C$(15),V(9) ,R(4) 

FOR X=@ TO 15:READ A$:CS$ 
(X) =AS:NEXT 

FOR X=G TO 9:READ A:V(X) 
=A:NEXT 

FOR X=@ TO 44:READ A:POK 
E X+32768,A:NEXT 

R(G) =1:R(1)=2:R(2)=5:R(3 
)=6:R(4)=7 
TS="YES":S=1185:KS="A":X 
=0 
BS="{WHT}- 


POKE53272,23:POKE53281, 
6: POKE5328G,11 
PRINT" {CLR} {DOWN} {7} 
{16 SPACES}** DEMO MAKE 
R **e" 

PRINT"{2 DOWN} 

{3 SPACES}{WHT}TITLE LE 
TTERS{2 SPACES}COLOR: 
£6¥"CS(V (GB) ) 

PRINT"{3 SPACES} {WHT}SC 
ROLLING TEXT COLOR: {6} 
"C$ (V(1)) 

PRINT"{3 SPACES} {WHT}TE 
XT ON RASTER COLOR: {6} 


CE 


HD 


Dx 


FJ 


DG 


SG 


QR 


156 


166 


176 


186 


196 


260 


216 


226 
230 
246 
256 
260 
276 


280 
296 


386 
310 
320 
330 


340 
356 
360 
370 
386 
396 
406 
416 


426 


"C$ (V(2)) 
PRINT" {3 SPACES} {YEL}MI 
D BACKGROUND COLOR: {7} 
"C$ (V(3)) 
PRINT"{3 SPACES} {YEL}LO 
W BACKGROUND COLOR: {7} 
"C$ (V(4)) 
PRINT"{3 SPACES} {GRN}MA 
IN RASTER{2 SPACES}PART 
1: €3}"C$(V(5))" SHADE 
s" 
PRINT"{3 SPACES} {GRN}MA 
IN RASTER{2 SPACES}PART 
2: £3}"C$(V(6))" SHADE 
3" 
PRINT"{3 SPACES} {GRN}SM 
ALL RASTER COLORS: 
{PUR} "CS(V(7))" SHADES" 
PRINT"{3 SPACES} {GRN}MI 
DDLE FADER COLORS: 
{PUR}"C$(V(8))" SHADES" 
PRINT"{3 SPACES} {CYN}FA 
DER SPEED (6 TO 10): 
{PUR} "V(9) 
PRINT"{3 SPACES}{YEL}AN 
IMATE TITLE: {6}"TS$ 
PRINT"{3 SPACES} {WHT }EN 
TER TITLE TEXT" 
PRINT"{3 SPACES}ENTER 
CROLLING TEXT" 
PRINT"{3 SPACES}ENTER M 
IDDLE TEXT" 
PRINT"{3 SPACES} {CYN}SA 
VE THE DEMO" 
PRINT"{2 DOWN} {6} 
{4 SPACES}PRESS SPACE T 
O PREVIEW THE DEMO" 
SC=S+X*40:POKE SC,62:PO 
KESC+54272,1 
GET CS$:IFCS$="{DOWN}" AN 
D X<14 THEN POKESC,32:X 
=X+1 
IFCS="{UP}"AND X>@ THEN 
POKESC, 32:X=X-1 
IF C$ <> "+" THEN 356 
IF X<=4 THEN IF V(X)<15 
THEN V(X) =V(X)+1:GOTOL 
oo 
IF X=9 THEN IF V(X)<10 
{SPACE}THEN V(X) =V(X)+1 
:GOTO168 
IF X<=8 THEN IF V(X)<7 
{SPACE}THEN 480 
IF C$ <> "-" THEN 396 
IF X<=4 THEN IF V(X)>@ 
{SPACE}THEN V(X) =V(X)-1 
:GOTO100 
IF X=9 THEN IF V(X)>0 T 
HEN V(X) =V(X)-1:GOTO106 
IF X<=8 THEN IF V(X)>1 
{SPACE}THEN 566 
IF X=10 AND C$=CHR$(13) 
THEN 460 
IF X=11 AND 
THEN 770 
IF X=12 AND 
THEN 646 
IF X=13 AND 


ln 


CS=CHRS (13) 
CS=CHRS (13) 


CS=CHRS (13) 


HX 


SP 


PX 


PR 


AD 


PF 


FE 


430 
446 
456 
466 
478 
480 


496 
506 


510 
520 
530 
546 


558 
560 


576 
580 
596 
606 
610 
626 
638 


646 
656 


666 


678 


686 


698 
708 
719 


720 
730 


746 


756 


THEN 766 
IF X=14 AND C$=CHR$(13) 
THEN 1168 

IF C$="_" THEN POKE 189 
85,2:GOSUB 940:SYS 1869 
8:GOTO 100 

GOTO 280 

IFTS$="YES" THEN TS="NO" 
:GOTO10G 

IFTS$="NO" THEN TS="YES" 
:GOTO180 

V(X) =V(X)+1:1F V(X) =3TH 
ENV (X) =5 

GOTO106 

V(X) =v (X)-1:1F V(X) =4TH 
ENV (X) =2 

GOTO106 

REM * TEXT INPUT * 

M=@ 

PRINT"{RVS}{WHT} {OFF}" 


; 
GET CS$:IFCS=""THEN55@ 
PRINT" {LEFT} {LEFT}";: 
FCS=CHR$(13)THEN RETURN 
IFC$<>CHR$ (20) THEN610 
IF M=QTHEN54@ 

M=M-1: PRINT" {LEFT} 
{LEFT}"; :IFM<1THEN53@ 
GoTO546 

IF C$="{F1}"THEN RETURN 
IFM>=LE OR (CS$<" "ORCS> 
"2") THENS4G 
M=M+1:PRINTCS$; :GOTO546 
REM * SCROLLING TEXT * 
PRINT CHR$(147)BS" 

{16 DOWN}"BS"{YEL} 
{DOWN}ENTER THE SCROLL 
{SPACE}TEXT NOW." 
PRINT" {DOWN}PRESS <RETU 
RN> TO STORE,{2 SPACES} 
<F1l> TO ABORT {HOME} 
{WHT } {DOWN}"; 

FOR Y=16864 TO 17263:PO 
KE Y-15860,PEEK(Y) :NEXT 
:LE=398:GOSUB 520 

IF C$<>"{F1}"THEN FOR Y 
=1064 TO 1463:POKE Y+15 
800,PEEK(Y):POKE Y,42:N 
EXT) - 

GOTO106 

REM * MIDDLE TEXT * 
PRINT CHR$(147)BS" 

{12 DOWN}"BS"{YEL} 
{DOWN}ENTER THE MIDDLE 
{SPACE}TEXT NOW. 

{2 SPACES}FIRST AND 
PRINT"LAST LINES ARE TE 
XT ON RASTERS." 

PRINT" {DOWN}PRESS <RETU 
RN> TO STORE,{2 SPACES} 
<F1> TO ABORT {HOME} 
{WHT } {DOWN} "; 

FOR Y=16384 TO 16863:PO 
KE Y-15320, PEEK (Y) :NEXT 
tLE=479:GOSUB 520 

IF C$<>"{F1}"THEN FOR Y 
=1664 TO 1543:POKE Y+15 
320,PEEK(Y):POKE Y,42:N 


JUNE 1992 COMPUTE G-29 


PROGRAMS 


768 
778 
786 


798 
800 
810 


826 


830 


846 
850 


866 
876 
886 
890 


906 
916 


926 
930 
940 
959 
966 


976 
986 


998 


EXT Y 
GOTO168 

REM * TITLE * 

PRINT CHRS$(147)B$" 

{2 DOWN}"BS"{YEL} {DOWN} 
ENTER THE TITLE LETTERS 

“NOW.” 
POKE1084,45:POKE1124,45 
PRINT" {DOWN}18 LETTERS 
{SPACE}PER LINE (SPACES 
INCLUDED) " 

PRINT"NO PUNCTUATION IS 
ALLOWED IN TITLE." 
PRINT" {DOWN}PRESS <RETU 

RN> AT END OF EACH LINE 
iW 


FOR Y=18341 TO 18360:P= 
Y-17277:V=PEEK(Y):IF V< 
>32 THEN V=V-64 
POKEP,V:NEXT 

FOR Y=18361 TO 18386:P= 
Y-17257:V=PEEK(Y):IF V< 
>32 THEN V=V-64 
POKEP,V:NEXT 

PRINT" {HOME} {WHT} {DOWN} 
"+; :LE=19:GOSUB529 
PRINT: LE=19:GOSUB5206 
FOR Y=1664 TO 1683:P=Y+ 
17277: V=PEEK(Y) : IF V<>3 
2 THEN V=V+64 
POKEP,V:POKE Y,42:NEXT 
FOR Y=1104 TO 1122:P=Y+ 
17257: V=PEEK(Y) :IF V<>3 
2 THEN V=V+64 
POKEP,V:POKE Y,42:NEXT 
GOTO1G8 

REM * CUSTOMIZER * 
PRINT" {CLR}" 
AD=18333:POKE AD,V(9):P 
OKE AD+1,V(2):POKE AD+2 
7V(@):POKE AD+3,V(1) 
POKE AD+4,@0:IF TS$="YES" 
THEN POKE AD+4,1 

POKE AD+6,V(3):POKE AD+ 
7,V(4) 

REM * RASTERCOL * 


1666 Y=32768:FOR T=6 TO 3:1 


F R(T)<>V(7) THEN Y=Y¥+ 
9:NEXT 


1610 A=18312:GOSUB1696 

1626 Y=32768:FOR T=@ TO 3:1 
F R(T)<>V(8) THEN Y=Y+ 
9:NEXT 

1036 A=18321:GOSUB1696 

1046 Y=32768:FOR T=6 TO 3:1 
F R(T) <>V(5) THEN Y=Y+ 
9:NEXT 

1656 A=18264:FOR T=Y TO Y+7 
:FOR U=@ TO 2:POKE A,P 
EEK(T) :A=A+1:NEXT U:NE 
xT T 

1069 Y=32768:FOR T= TO 3:1 
F R(T)<>V(6) THEN Y=Y¥+ 
9:NEXT 

1670 A=18288:FOR T=Y TO Y+7 


:FOR U=6 TO 2:POKE A,P 
EEK(T) :A=A+1:NEXT U:NE 
xT T 


COMPUTE JUNE 1992 


XF 
AB 


1686 
1696 


RETURN 

FOR T=Y TO ¥+9:POKE A, 
PEEK (T) :A=A+1:NEXT: RET 
URN 

REM{2 SPACES}* SAVE * 
GOSUB 949: INPUT"{CLR} 
{WHT} {DOWN} SHOULD DEMO 
BOOT ANOTHER FILE? Y 
{3 LEFT}";A$ 

IF AS="N" THEN POKE 18 
985,2:GOTO 1200 
PRINT"{CLR}{2 DOWN}"BS 
"{YEL}ENTER THE NAME O 
F FILE TO BOOT" 

PRINT" (TYPE '*' AT END 
OF NAME) {HOME}": POKE1 
080,45:LE=15:GOSUB526 
FOR Y=1064 TO 1679:A=Y 
+17922:V=PEEK(Y):IF V 
{SPACE}> @ AND V < 27 
{SPACE}THEN V=V+64 
POKE A,V:NEXT: PRINT 
INPUT"{4 DOWN} {CYN}ENT 
ER SYS (RETURN=BASIC)" 
7SY 

IF SY=6 THEN POKE18985 
,1:GOTO 1206 

POKE 18985,6:H=INT (SY/ 
256) :L=SY-256*H:POKE 1 
9636,L:POKE 19637,H 
INPUT" {CLR} {2 DOWN} 
{WHT}FILENAME OF DEMO" 
7FS 

PRINT"{2 DOWN} {GRN}SAV 
ING DEMO..."; 

OPEN2,8,2,"G:"+FS+",P, 

w" 

PRINT#2, CHRS$ (1) ;CHRS( 
8)5 

FOR J=16252 TO 19064:P 
RINT #2,CHR$ (PEEK (J) ) ; 
IF ST > @ THEN PRINT" 
{SPACE}ERROR DURING SA 
VE": PRINT#2:CLOSE2:END 
NEXT:CLOSE2:PRINT" NO 
{SPACE}ERRORS":END 
DATA BLACK,WHITE,RED,C 

YAN, PURPLE, GREEN, BLUE, 
YELLOW 

DATA ORANGE,BROWN,LT R 

ED,DK GRAY,MED GRAY,LT 
GREEN,LT BLUE,LT GRAY 

DATA G,1,11,6,5,1,2,6, 
75 

DATA G,11,12,15,1,1,15 
plaid 

DATA 0,9,2,8,10,10,8,2 
9 

' 

DATA 8,5,3,13,1,1,13,3 
5 

a 

DATA 0,6,14,3,1,1,3,14 
6 

, 

DATA 16,7,13,3,14,3,13 
77,18 


QE 1190 
KJ 1116 


AB 1120 


EX 1136 


CF 1146 


XM 1156 


1166 
1178 


AQ 
XF 
DD 1186 


sc 1196 


MF 1260 


PK 1219 
BG 1226 
XH 1236 
HB 1246 


cs 1256 


PG 1260 


AM 1276 


HA 1286 


JP 1296 


BK 1300 
SF 1316 
KF 1326 
XD 1336 


FF 1346 


Danny English is a frequent contributor 
who lives in Moreno Valley, California. 


F/X PLOT 128 


By Kevin Davis 

At one time or another, any student of 
mathematics has had to deal with coor- 
dinate plane graphing. Graphing calcu- 
lators have been recognized by educa- 
tors as helpful tools for understanding 
graphs, but these calculators can cost 
up to $300. 

While programs such as Arbplot exist 
for Apple and IBM computers, few are 
available for 8-bit Commodores. F/X Plot 
128 tries to change this. The program it- 
self was designed using the popular TI- 
81 as abenchmark. It's amenu-driven, us- 
er-friendly, colorful program designed to 
make good use of the 128's high-resolu- 
tion graphics in 40-column mode. 


Entering the Program 

F/X Plot 128 consists of a main pro- 
gram and a sprite. The main program 
is written in BASIC 7.0 and should be 
entered with The Automatic Proofread- 
er to avoid typing errors. See “Typing 
Aids" elsewhere in this section. 

The sprite data used to create an on- 
screen pointer or tracer is written in ma- 
chine language. Enter it with MLX, our 
machine language entry program. See 
“Typing Aids’ again. When MLX 
prompts, respond with the following val- 
ues. 


Starting address: OE00 
Ending address: OE3F 


Be sure to save the program as F/X 
PLOT.SPR on the same disk as the 
main program. The main program 
loads this data when it runs. 

When you first run F/X Plot, the top 
of the screen will be jumbled. Clear the 
screen from the Options menu, press 
Run/Stop-Restore, and then run the pro- 
gram again. This process is required on- 
ly when you first run the program. 

From then on, you'll see a screen di- 
vided into quarters with a menu at the 
bottom. The program is completely 
menu driven. First, let's look at the Op- 
tions menu. Press 4. 

With this menu, you'll be presented 
with five numbered options. Press the 
number in front of the one you want. 


Simultaneous/Sequence F/X Plot can 
hold formulas for up to four graphs. 


Simultaneous will graph all selected for- 
mulas at the same time. Sequence 
graphs them one at a time. Always se- 
lect Sequence when you have only 
one formula to graph. (Sequence is al- 
so a little faster in this case.) 


Enable/Disable Formulas You can 
toggle here to enable or disable cer- 
tain formulas. Only the enabled ones, 
denoted by their numbers appearing in 
reverse mode, will be graphed. 


Clear Graphics Screen This will 
clear the graphics screen and return 
you to the Main menu. 


Set Tracer Speed This option allows 
you to set the speed at which the trac- 
er moves. A smaller number will move 
more slowly but will be more accurate. 
Three is the default. 


Connected/Dotted This works ina 
fashion similar to the Enable/Disable tog- 
gle. The formulas set to Connected 
will draw a line between each plotted 
point. Experimentation with the pro- 
gram will give you an idea of when it’s 
a good idea to set formulas to Connect- 
ed. Connected formulas are in reverse. 


Use the Esc key to move from the Op- 
tions screen to the Main menu. Here 
are the Main menu options. 


Set Range Set the X-Minimum (the 
least x value graphed), X-Maximum 
(the greatest x value graphed), Y-Min- 
imum, and Y-Maximum. Defaults are - 
10 to 10 on both axes. The resolution 
(scaling) of the graph is determined by 
the distance between the maximum 
and minimum values. In other words, a 
range of -1 to 1 will appear much clos- 
er in (like a zoom lens) and have a high- 
er resolution than -100 to 100. For trig- 
onometric graphs, use plus or minus 
3.14 as pi and plus or minus 6.28 as 
two pi. 


Tracer The Tracer requires a joystick 
in port 2. When you choose this, you'll 
see the range values and a gray de- 
vice somewhat like cross hairs in the up- 
per left corner of the screen. Its speed 
is controlled from the Options menu. 
You're shown the x-coordinate and y- 
coordinate of the cross hairs as they 


move around the screen. This option 
can be helpful in evaluating certain 
points along the graph. 

In order to zoom into a section of the 
graph, move to the upper left corner of 
the rectangular section you want to 
zoom into and press and release the 
fire button. There will be a bell tone 
and a brief pause. Then move the 
cross hairs to the lower right corner 
and do likewise. This process sets the 
next range of values. Use the Esc key 
to exit, select Clear from the Options 
menu, and choose Graph from the 
Main menu to proceed. 


Graph This is the most important, and 
easiest, function of F/X Plot. It graphs 
the enabled functions on the screen. 
Each function is graphed in its corre- 
sponding color as shown in the Enable/ 
Disable menu. As each point is 
graphed, its x and y values are printed 
at the bottom of the screen. The coor- 
dinates of the last five points graphed 
are visible at the bottom of the screen. 
To pause the graphing, use the No 
Scroll key. 

If the program attempts to graph a 
value that BASIC cannot handle (such 
as the point on an asymptote in a trig- 
onometric function), a bell tone will 
sound, and that point won't be 
graphed. An error-trapping routine pre- 
vents the program from stopping. It'll 
just move on to the next value. 


Plotting Functions 

F/X Plot comes with four formulas al- 
ready entered, but, naturally, you'll 
want to enter your own. These are 
stored as DEF DN statements in lines 
60-90. The BASIC DEF FN command, 
however, cannot be implemented from 
program mode. In order to set or 
change the formulas, you must exit the 
program by pressing the Run/Stop- 
Restore keys simultaneously. Type 
LIST 60-90 and press Return. 

Then use the cursor keys to edit 
each line with the formula of your 
choice for FN(A), FN(B), FN(C), and 
FN(D). Remember to press Return after 
entering your formulas. Then run the 
program again. 

All formulas must be entered using 
BASIC’s normal mathematical com- 
mands. These include SIN, COS, LOG, 
TAN, ABS, and operators +, -, *, and /. 


Anyone who has ever done any pro- 
gramming should be familiar with 
these operators and their use. New us- 
ers may want to check the appendix 
dealing with mathematical commands 
in the 128 System Guide for the prop- 
er format. 


Helpful Hints 

While the program can graph only four 
functions at once, the graphics screen 
isn't erased when you stop the pro- 
gram. If you want to graph more than 
four formulas, graph the first four, exit 
the program, change the formulas, run 
the program again, and graph the sec- 
ond group. The graphs will overlap as 
long as you make sure that the ranges 
are the same. 

Don't wait until the night before your 
big geometry examination to learn how 
to use F/X Plot 128! It's a powerful and 
versatile program that can be utilized ful- 
ly only by thorough use and repeated 
experimentation. 

While the theory is untested, I'd imag- 
ine that any program that captures the 
hi-res split screen and sends it to a print- 
er could be used to make hardcopies 
of any graphs you create. 


F/X PLOT 128 


RP 5 REM COPYRIGHT 1992 COMPUT 
E PUBLICATIONS INTL LTD 
{2 SPACES}ALL RIGHTS RESE 
RVED 

HX 10 CLR: XM=~10:XX=10: YM=-10: 

YX=10:SP=3:EA=1:EB=1:EC= 

1:ED=1:TRAP 1899 

DIMJA (8) :DIMJB(8) :FORKQ= 

1T08:READJA (KQ) :NEXT 

BLOAD("E/X PLOT.SPR") 

FOR KQ=1T08:READJB(KQ) :N 

EXT 

POKE53286,@: POKE53281,0 

DEF FN A(X)=XT2 

DEF FN B(X)=X+4 

DEF FN C(X)=((SIN(X))) 

DEF FN D(X)=(~1*(SQR(X)) 


SA 26 


RK 39 
Ps 46 


MA 50 
AQ 66 
PF 70 
EJ 86 
QK 9G 


) 
MA 1060 
MM 119 
KS 126 


GRAPHIC 4,0 

REM DRAW ZEROS 

IF XM<@ AND XX>@ THEN X 
Z=1 

IF YM<@ AND YX>@ THEN Y 
Z=1 

GOSUB 848 
SLEEP1:GOTO89@ 

GOSUB 776 

IF XZ<>1 THEN 270 

REM DRAW X-~ZERO 
AM=ABS (XM) :XL=AM/XR 


JUNE 1992 COMPUTE 


RP 130 


RR 156 
FR 169 
MB 200 
CG 210 
SM 220 
DG 236 


G-31 


PROGRAMS 


DA 240 XL=166*XL FD 700 IF XD>YX OR XD<YM THEN NU{7}{2 SPACES}" 
BE 250 COLOR 1,16 {SPACE}740 HX 1636 PRINT"{RVS}{H}3{N} 
GG 260 DRAW 1,XL,@ TO XL,159 DF 716 QP=YX-XD:FP=QP/YR:CP=16 {OFF} CLEAR GRAPHIC SC 
FH 276 IF YZ<>1 THEN 326 6*FP:COLOR1,11:DRAW1,TT REEN" 
KR 286 YQ=ABS (YM) :YU=YQ/YR 7cP EF 1648 PRINT" {RVS}{H}4{N} 
SK 296 YL=160*YU:YL=166-YL XB 72@ IF TT=G OR CQ<>1 THEN74 {OFF} SET TRACER SPEED 
HB 300 IF YL>16G OR YL<@ THEN 6 in 
{SPACE}320 JC 73@ DRAW1,TT,CP TO ID,PD:ID | GM 1050 PRINT" {RVS}{H}5{N} 
DB 314 COLOR2,16:DRAW1,8,YLTO1 =TT: PD=CP {OFF} CONNECT/DOTTED"; 
59,YL AE 740 IF EA=1 OR EB=1 OR EC=1 | XX 1060 GETKEY GKS$: IFGK$=CHRS ( 
EG 320 REM PLOT OR ED=l1 OR SS=@9 THEN N 27) THEN 890 
EE 330 XS=XR/160:YS=YR/160 EXT TT PK 1678 GK=VAL(GKS) :IF GK>50RG 
MH 340 UX=@:UY=0 AP 758 IF EA=@ AND EB=@ AND EC K<1THEN1G68 
FD 356 FOR TT=@TO159 =@ AND ED=@ THEN 760 BS 1986 ON GK GOTO 1699,1160,1 
JJ 360 IF EA=0 THEN 46¢ EJ 768 GOTO890 370,1466,1696 
JX 370 XA=FNA((XM+(TT*XS) )) BC 776 IF XX<=@ AND XM<=@ THEN | RB 1699 PRINT"{CLR}{26 DOWN} 
BA 386 PRINT" {CYN}X="( (XM+(TT* XR=ABS (XM) ~ABS (XX) {GRN}1] SEQUENCE (GRAP 
XS) ))TAB(2G) "Y="XA BF 780 IF XX>@ AND XM<@ THEN X HED IN ORDER)" 
RK 398 IF XA>YX OR XA<YM THEN R=ABS (XM) +ABS (XX) PR 116@ PRINT"2] SIMULTANEOUS 
{SPACE}45@ MG 796 IF XM>@ THEN XR=XX-XM {SPACE} (GRAPHED AT SAM 
460 QP=YX-XA:FP=QP/YR:CP=16 | AM 860 IF YX<=9 AND YM<=@ THEN E TIME)" 
G*EP YR=ABS (YM) ~ABS (YX) SS 1110 GETKEY GK$:GK=VAL(GK$) 
416 COLOR 1,4 HR 810 IF Y¥X>@ AND YM<@ THEN Y : IFGK=1THENSS=1 
426 DRAW 1,TT,CP R=ABS (YM) +ABS (YX) GQ 1120 IF GK=2 THEN SS=6 
430 IF TT=6 OR CA<>1 THEN4S | AD 82@ IF YM>@ THEN YR=YX-YM CF 1130 IF GKS$=CHR$(27) THEN 8 
6 GP 830 RETURN 90 
440 DRAW1,TT,CP TO IA,PA:IA | FP 848 REM PIC FP 1149 IF SS<GORSS>1THEN1110 
=TT:PA=CP FE 850 PRINT"{CLR}{26 DOWN}"; HM 1158 GoTO89a 
456 IF SS=1 THEN NEXT TT XP 860 PRINT" {YEL}{40 @}" MR 1160 PRINT"{CLR}{2@ DOWN} 
466 IF EB=@ THEN 579 DJ 876 PRINT"{YEL}{16 @}{3}F {1}PRESS FORMULA TO EN 
476 IF SS=1 THEN UX=@:UY=G: {CYN}/{7}xX {6}PLOT{YEL} ABLE (HI-LIGHTED)" 
FOR TT=9 TO 159 {16 @}" JS 1178 PRINT"OR DISABLE. 
480 XB=FNB((XM+(TT*XS) )) CX 889 RETURN {RVS}RETURN{OFF} EXITS 
496 PRINT"{GRN}X="((XM+(TT* | BD 896 GOSUB84G:PRINT" {6} -" 
XS) )) TAB (20) "Y="XB {RVS}{H}1{N}{OFF} SET R | KH 1189 IF EA=1THENPRINT"{7} 
50@ IF XB>YX OR XB<YM THEN ANGE VALS{2 SPACES} {RVS}{G}1{N}{OFF}";:GO 
{SPACE}566 {RVS}{H}2{N} {OFF} USE T 701206 
516 QP=YX-XB:FP=QP/YR:CP=16 RACER" JA 1196 IF EA<>l THEN PRINT" 
G*FP AH 990 PRINT" {RVS}{H}34{N} 7d us 
528 COLOR1,6 {OFF} GRAPH FUNCTION EX 1200 IF EB=1THENPRINT"{GRN} 
536 DRAW 1,TT,CP {2 SPACES} {RVS}{H}4{N} {RVS}{H}2{N}{OFF}";:GO 
540 IF TT=6 OR CB<>1 THEN56 {OFF} OPTIONS" 701220 
@ DB 916 GETKEY GK$:GK=VAL(GKS$): | PP 1219 IF EB<>l THEN PRINT" 
550 DRAW1,TT,CP TO IB,PB:IB IF GK>4 OR GK<1 THEN 91 {GRN} 2 "; 
=TT: PB=CP @ RS 1220 IF EC=1THENPRINT"{YEL} 
560 IF SS=l1 THEN NEXT TT RG 9296 ON GK GOTO 939,1456,176 {RVS}{H}3{N}{OFF}"; :GO 
570 IF EC=@ THEN 660 1996 : 701249 
580 IF SS=l THEN UX=@:UY=@: | PG 930 REM SET VALUES KH 1236 IF EC<>l THEN PRINT" 
FORTT=6T0159 ~ | MX 946 INPUT"{CLR}{28 DOWN}X-M {YEL} 3 "; 
590 XC=EFNC ( (XM+(TT*XS))) INIMUM [XMIN]";XM PQ 1249 IF ED=1THENPRINT"{3} 
66@ PRINT"{YEL}X="((XM+(TT* | KB 956 INPUT"X-MAXIMUM [XMAX]" {RVS}{H}44N}{OFF}";:GO 
XS) )) TAB (20) "Y="xXC 7XxX TO1260 
618 IF XC>YX OR XC<YM THEN MD 966 INPUT"Y-MINIMUM [YMIN]" | CQ 1259 IF ED<>1 THEN PRINT" 
{SPACE}650 7¥M {3} 40"; 
626 QP=YX-XC:FP=QP/YR:CP=16 | QG 976 INPUT"Y-MAXIMUM [YMAX]" | QX 1268 GETKEY CD$:IFCDS=CHRS ( 
O*FP:COLOR1,8:DRAW1,TT, 7¥X 13) THEN89G 
cP GM 988 PRINT"{CLR}":GOTO899 JR 127@ CD=VAL(CD$) : IFCD>40RCD 
636 IF TT=6 OR CC<>1 THEN65 | PD 9946 REM OPTIONS MENU <1THEN126¢ 
6 MJ 1606 PRINT"{CLR}{19 DOWN} BB 1284 IF CD=l AND EA=@ THEN 
648 DRAW1,TT,CP TO IC,PC:IC {8 SPACES}{7} {SPACE }EA=1:GOTO1396 
=TT:PC=CP {26 SPACES}" EP 1299 IF CD=l1 AND EA=1 THEN 
GB 650 IF SS=1 THEN NEXT TT QP 1916 PRINT"{RVS}{H}1{N} {SPACE}EA=G 
KR 6690 IF ED=@ THEN 749 {OFF} SIMULTANEOUS/SEQ | BG 1368 IF CD=2 AND EB=9 THEN 
GD 670 IF SS=1 THEN UX=@:UY=@: UENCE{3 SPACES}{3}0PTI {SPACE} EB=1:GOT01326 
FORTT=9T0159 ONS{7}" KE 1319 IF CD=2 AND EB=l THEN 
PF 686 XD=FND((XM+(TT*XS))) XM 1926 PRINT"{RVS}{H}2{N} {SPACE} EB=G 
SR 690 PRINT"{3}X="( (XM+ (TT*XS {OFF} ENABLE/DISABLE F | SB 1326 IF CD=3 AND EC=@ THEN 
))) TAB (26) "Y="XD ORMULAS{3 SPACES}{3}ME {SPACE }EC=1:G0T01340 
G-32 COMPUTE JUNE 1992 


DD 


1338 
1346 
1358 


1366 
1376 


1386 


13968 
1406 


1416 


1426 
1436 


1446 
1458 
1468 
1476 
1486 
1496 


1506 
1519 
1529 
1536 
1546 
1556 
1569 
1576 


1586 
1596 


1686 


1618 
1628 
1636 
1648 
1656 


1666 


1676 


1689 
1696 


1706 


IF CD=3 AND EC=1 THEN 
{SPACE} EC=6 

IF CD=4 AND ED=@ THEN 
{SPACE }ED=1:GOTO1360 
IF CD=4 AND ED=1 THEN 
{SPACE}ED=6 
PRINT"{UP}":GOTO 1180 
PRINT"{CLR}{22 DOWN} 
{WHT}CLEAR SCREEN: ARE 
YOU SURE?" 

GETKEY YNS:IF YNS="Y"T 
HENGRAPHIC4,1 

GOTO 890 

PRINT" {CLR}{21 DOWN} 
{PUR}" 

PRINT"CURRENT SPEED: 
{WHT} "SP: PRINT" {PUR}EN 
TER NEW VALUE [1-5]" 
GETKEY SPS$:IF SP$=CHRS 
(27) THEN8 98 
SP=VAL(SP$):IF SP<10RS 
P>5THEN1429 

GoT089¢0 

REM TARGET~SCAN 

ZX=XM: ZY=YX 

PX=17: PY=-209: PN=0 
PRINT"{CLR}{33 DOWN}" 
PRINT" {YEL}X-MIN: "XM"" 
TAB (20) "X-MAX: "XX: PRIN 
T"Y-MIN: "YM" "TAB (20) "Y 
~MAX: "YX 

SPRITE1,1,2,0 
MOVSPR1, PX, PY 

GOSUB770 
XS=XR/160:YS=YR/168 
JS=G:JIS=JOY (2) 

IF JS>128 THEN154¢ 

IF JS=128 THEN 1660 
PX=PX+ (JA (JS) *SP) :PY=P 
Y+(JB(JS) *SP) 
MOVSPR1, PX, PY 
ZX=XM+ (.5*( (PX-17) *XS) 
) :ZY=YX~((PY+269) *¥S) 
PRINT" {6} {HOME} 

{21 DOWN}X="ZX""TAB (26 
)"y=" (ZY) 

GETX$: IFX$=CHRS$ (27) THE 
NGOTO163@ 
JS=6:GOTO1540 
SPRITE1,@ 

GOTO890 

DATA 8,1,1,1,8,-1,-1,- 
1,-1,-1,0,1,1,1,9,-1 
PN=PN+1:IF PN=l1 THEN A 
X=ZX:AY=ZY: PRINT CHR$( 
7) :SLEEP1:GOTO1548 

IF PN=2 THEN BX=ZX:BY= 
ZY:PRINT CHRS$(7) :XM=AX 
:XX=BX: YX=AY: YM=BY:GOT 
01548 

GOTO1549 
PRINT"{CLR}{2@ DOWN} 
{PUR}SELECT DOTTED OR 
{SPACE}CONNECTED / 
{RVS}RETURN{OFF}" 

IF CA=1THENPRINT"{7} 
{RVS}{H}1{N} {OFF} 
701726 


QD 1719 IF CA<>1 THEN PRINT" 
L751 13 

IF CB=1THENPRINT" {GRN} 
{RVS}{H}2{N}{OFF}";:GO 
701740 

IF CB<>1 THEN PRINT" 
{GRN} 2 "; 

IF CC=1THENPRINT"{YEL} 
{RVS}{H}3{N}{OFF}";:GO 
701766 

IF CC<>1 THEN PRINT" 
{YEL} ae 

IF CQ=1THENPRINT"{3} 
{RVS} {H}4{N}{OFF}";:GO 
T01786 

IF CQ<>1 THEN PRINT" 
£33,407 

GETKEY SQS:IFSQS=CHRS ( 
13) THEN899 

SQ=VAL (SQ$) : IFSQ>40RSQ 
<1THEN178¢ 

IF SQ=1 AND CA=6 THEN 
{SPACE }CA=1:GOT01820 
IF SQ=1 AND CA=1 THEN 
{SPACE}CA=0 

IF SQ=2 AND CB=@ THEN 
{SPACE}CB=1:GOTO1846 
IF SQ=2 AND CB=l THEN 
{SPACE}CB=0 

IF SQ=3 AND CC=@ THEN 
{SPACE }CC=1:GOTO1860 
IF SQ=3 AND CC=1 THEN 
{SPACE}CC=9 

IF SQ=4 AND CQ=@ THEN 
{SPACE}CQ=1:GOTO1886 
IF SQ=4 AND CQ=1 THEN 
{SPACE}CQ=8 

PRINT" {UP}":GOTO 1708 
REM ERROR TRAP ROUTINE 
IF ER=1l OR ER=14 OR E 
R=20 OR ER=10 OR ER=15 
THEN PRINT" {G}";:RESU 
ME NEXT . 

PRINT" PROGRAMMING ERRO 
R:" 

PRINT" {RVS}";:PRINTERR 
$(ER);:PRINT" {OFF}" 
PRINT"{8}IN LINE"EL 
END 


Gx 1726 


HP 1736 


KS 1746 


BE 1758 


1768 


1778 
1788 
1796 
1860 
1816 
1826 
1838 
1846 
1858 
1866 
1876 
1886 


1896 
19696 


1916 
AC 1926 


AX 
CK 


1938 
1948 


F/X PLOT.SPR 


GEGG:02 
GEG8:60 
GE16: 


1) 
28 
G2 
Ct) 
oo 
Ui) 
1) 
C1) 


GA 
ao 
Ut) 
C1) 
6G 
U1) 
0@ 
a6 


80 
28 
Go 
Ul) 
i) 
68 
6@ 
GG 


Go 
AG 
Go 
OG 
U1) 
1) 
Ct) 
OG 


28 
1) 
Cy) 
GG 
Oo 
CT) 
U1) 
0G 


AG 
GA 
Cy) 
Cr) 
Go 
ao 
1) 
Ct) 


B2 
ths 
AC 
34 
3c 
44 
4c 
54 


GE30: 00 
GE38:06 


Kevin Davis is the author of Sport 
Card Collector (November 1991). F/X 
Plot 128 helped him survive honors ge- 
ometry this year at Trinity Preparatory 
School in Winter Park, Florida. 


SPRINT Ill 


By Farid Ahmad 

Commodore BASIC isn't exactly known 
for its speed. It's not the language itself 
that's at fault, however; it's the way the 
computer implements the language. BA- 
SIC is interpreted. Most faster languages 
are compiled. 

Before a computer can execute any 
program, the commands must be con- 
verted into the machine language of the 
computer. Every time a statement in an in- 
terpreted language is run, the computer 
musttranslate it. This slows execution con- 
siderably. A compiler, however, trans- 
lates the entire program before it runs. 
This boosts execution speed. 

Sprint lll isa BASIC compiler that sup- 
ports a subset of BASIC statements avail- 
able to the 64. Earlier versions of the pro- 
gram were published in January 1986 
and January 1988. Sprint Il added sever- 
al features to its original version, but 
there was still room for improvement. 


Entering the Program 

Sprint Ill is written entirely in machine 
language. To enter it, use MLX, our ma- 
chine language entry program. See 
“Typing Aids” elsewhere in this sec- 
tion. When MLX prompts, respond 
with the following values. 


Starting address: 0801 
Ending address: 1D40 


Be sure to save a copy of Sprint Ill be- 
fore exiting MLX. 


Using the Program 
A typical session with Sprint Ill might 
start with the following commands. 


LOAD “Sprint Iil”,8,1 
NEW 
SYS32768 


At this point your screen will turn 
black and BASIC pointers will be adjust- 
ed. You'll also see a SYNTAX ERROR 
message, which you should ignore, 
and a READY prompt. Now you can 
load a BASIC program or start to write 
one from scratch, You may run your pro- 
gram at any time for testing. When you 
are ready to compile it, use either the 
SYS32768,E or SYS32768,F command. 
These and other Sprint Ill commands 


JUNE 1992 COMPUTE G-33 


PROGRAMS 


are explained below. When the compila- 
tion finishes, you can run your com- 
piled program or save it as usual. 

If you want to make some correc- 
tions or modifications to your program, 
use the SYS32768,L command to load 
your BASIC program from the RAM 
disk. After it's edited, the program can 
be compiled as before. 


Commands 

All Sprint Ill commands consist of a 
SYS statement followed by a comma 
and a single letter. The following com- 
mands are available. 


SYS32768,F Saves the BASIC pro- 
gram to the RAM disk and then com- 
piles it. The entire source program is 
listed during compilation. It also locks 
the RAM disk. 


SYS32768,E Same as above except 
that Sprint lists only lines containing an 
error. 


SYS32768,L Loads your source pro- 
gram after a compile operation. Un- 
locks the RAM disk. 


SYS32768,U Unlocks the RAM disk. 


A Better Way 

One of the advantages of using Sprint 
Il was speed. You could save the 
source code on disk; run Sprint Il; and 
get a compiled program in memory, 
ready to run. However, if you wanted to 
make corrections or modifications to 
your program, you had to load the 
source code, modify it, save it back to 
disk, and compile again. Since a pro- 
gram almost never works perfectly with- 
out a debugging session, this proce- 
dure soon became tedious. 

There's a better way. Sprint III turns 
Sprint into a RAM-based compiler. 
Now, when you compile your program, 
the source code is saved to a RAM 
disk and is compiled from there. When 
compilation is finished, you have two 
versions of your program in memory: 
the compiled program in the normal BA- 
SIC working area and the source pro- 
gram in the RAM disk. 

Suppose Sprint Ill has reported 
some errors during compilation or you 
simply want to make some modifica- 
tions. You issue the load command to 
G-34 COMPUTE JUNE 1992 


the RAM disk, and within seconds, 
your BASIC source program is back, 
ready for editing and recompiling. 


Speed 

Apart from the convenience of not hav- 
ing to save and load repeatedly, 
Sprint Ill also reduces compilation 
time by more than half. For even faster 
compiling, you're given the option of list- 
ing the entire BASIC program during 
compilation or listing only those lines 
that contain an error. If you choose the 
error-only option, time for compiling is 
reduced to less than one-fourth that of 
Sprint Il. 


Other Options 

A list pause has been provided. When 
a BASIC program is being listed to the 
screen during compilation, hold down 
any control key to freeze the display. 
This is useful for writing down any er- 
rors reported by Sprint Ill. 

One potential mistake that can oc- 
cur when using Sprint Ill is the one of 
accidentally compiling a program 
that's already compiled. Suppose that 
you want to load the source program 
but give the compile command by mis- 
take. The BASIC program in the RAM 
disk would be overwritten by the com- 
piled program, and you'd lose your 
source code. To prevent this, the RAM 
disk is automatically locked after each 
compilation. This prevents you from us- 
ing the compile command. It'll be un- 
locked automatically when you load 
your source program, or you can use 
the unlock command if you wish to 
start a new program. 


Expressions 

Sprint Ill works much the same as BA- 
SIC, but as with Sprint Il there are 
some differences you should keep in 
mind when programming. 

Strings are limited to ten characters 
unless specified otherwise. If you 
want to include more characters, dimen- 
sion the string as if it were an array. 

In numeric expressions, parenthe- 
ses aren't allowed. Unlike interpreted 
BASIC, expressions are evaluated strict- 
ly from left to right; there's no operator 
precedence. To get around this, you 
must break up the expression into sev- 
eral smaller expressions and then put 
the results back together. For example, 


the following expression: 
SUM =A+X*Y+B+I*J 
becomes 


Q1 = X*Y: 02 =I*J: 
SUM = A +01+B+02. 


You may get a NOT SUPPORTED error 
message if the statement is legal in 
Commodore BASIC but illegal in 
Sprint lll. You may get a SYNTAX ER- 
ROR message if a keyword is mis- 
spelled or extra parentheses are 
used. 


Memory Organization 

Memory locations $A000-$C7FF and 
$E000-$FFFF are used by the RAM 
disk. Since this is an 18K area of mem- 
ory, the BASIC program must fit within 
this length. You'll be warned if you ex- 
ceed this limit. A full 30K, however, is 
available for the compiled program. Al- 
so, if you run your BASIC source pro- 
gram for testing, a full 30K of working 
area is available for strings, variables, 
and so on, It's only the BASIC program 
text that shouldn't exceed 18K. 

Sprint Ill is designed to stay resident 
in memory while you edit your BASIC 
programs. Therefore, it moves down 
the top of the BASIC area pointer to pro- 
tect itself. To set this pointer, you can 
either use a Sprint Ill command before 
running a BASIC program or use 
SYS32768 without a letter. The second 
method will produce a SYNTAX ER- 
ROR message, but the pointer will be 
adjusted. Also, when the pointer is set, 
the list pause will become available for 
BASIC editing. 


Updates from Sprint Il 

Programmers who may have disassem- 
bled Sprint Il may be interested in the 
following changes. 

The address $8000 now jumps to 
$ABO0 where the new routines reside. 
The interface routine sets some point- 
ers and also the colors. It then looks for 
a comma followed by a letter. If a val- 
id command is found, the appropriate 
routines are called to move programs 
to or from the RAM disk. 

In Sprint Il, addresses $825E and 
$80A2 called a subroutine to initialize 
the disk file. They now call a new short 


routine at $802B which initializes the 
new input from the RAM disk routine. 

The area $8COD-$8C45 contained 
calls to a Kernal routine to get a byte 
from disk. These calls have been 
changed so that the new input from 
the RAM disk routine is called at 
$8815. 

The instruction at $C800 has been 
changed from LDA#$CO to LDA#$C8. 
As a result, Sprint now uses the memo- 
ry area $C800 onward for line number 
storage. 

When the E command is used, the 
JSR$8AAC instruction at $82B6 ad- 
dress is bypassed, preventing each 
line from being listed. Also the instruc- 
tion at $8A85 is changed from 
JSR$888C to JSR$8850. Address 
$8850 contains a short routine to print 
the current line. 

When Sprint Ill is used for the first 
time, it places the list freeze subroutine 
at $CFEC-$CFFF. | use Sprint III with a 
multifunction cartridge that causes prob- 
lems if the freeze routine is placed be- 
tween $8000 and $A000. 


SPRINT Ill 


9861:0B 68 76 17 9E 32 34 36 GE 
G809:37 6G GG BG 26 20 26 26 96 
@811:26 26 20 20 26 AG C4 BY G6 
G819:3C 68 99 F8 6G BY FD 68 F6 
@821:99 33 63 88 D@ Fl AG G9 4C 
@829:B9 6C 68 99 FF G3 88 DG Al 
@831:F7 A9 Dl 85 2D AQ 24 85 18 
@839:2E 4C G6 G1 16 66 G6 D1 93 
9841:24 B8 1B B9 6E G9 99 EB 44 
@849:07 C8 D@ F7 EE 62 G1 EE 19 
@851:05 61 C6 F9 DG ED A2 G3 23 
@859:20 34 63 FG 33 C9 87 DG 95 
@861:16 A2 G1 26 34 63 DB GA AG 
@869:A2 G4 28 34 63 18 69 G7 65 
6871:16 65 A2 GA 20 34 63 85 1D 
9879:A8 AS A7 85 A9 AS FE 85 FB 
@881:F7 AS FF 85 F8 29 6C G3 73 
@889:A5 F8 85 FF AS F7 85 FE 72 
@891:E8 26 34 G3 DG 1E A2 68 21 
@899:26 34 63 AG G2 84 AB 85 2A 
@8A1:A6 18 A5 FC 65 A6 85 F7 58 
@8A9:A5 FD 65 A7 85 F8 20 6C EF 
68B1:03 4C 13 G1 E8 26 34 G3 FB 
@8B9:DG 1C AG G3 84 AB EB 26 36 
G8C1:34 G3 FO 68 A2 G8 26 34 F4 
@8C9:G3 4C 5C G1 A2 BD 26 34 C7 
@8D1:63 E6 A7 4C SC @1 E8 26 AF 
G8D9:34 63 DO GA E8 26 34 G3 B2 
G8E1:18 69 G4 A8 DG D6 EB 26 37 
G8E9:34 63 D@ GA A2 G2 26 34 21 
G8F1:03 18 69 G6 D@ ED A2 G8 A2 
@8F9:26 34 03 DO E6 AD BB 85 F7 
G901:A7 A4 FB FG GC G6 FA 2A 37 
0909:26 A7 C6 FB CA D@ F2 A8 D8 


G911:60 
@919:85 
@921:FF 
0929:FF 
9931:61 
G939:22 
9941:C6 
G949:A8 
G951:F7 
G959:A9 
9961:F8 
G969:01 
G971:9A 
G979:09 
G981:FE 
G989:34 
9991:8D 
6999366 
@9A1:68 
G9A9:6A 
G09B1:34 
G9B9:A9 
69C1:76 
69C9:C9 
G9D1:E9 
G9D9: 8B 
O9E1:FF 
G9E9:3B 
G9F1:Al 
G9OF9:AS5 
GAG1:34 
GAG9:38 
GA11:CB 
GA19:D3 
GA21:C9 
GA29:0C 
GA31:69 
GA39:CB 
GA41:ED 
GA49:74 
GA51:66 
GA59:66 
GA61:42 
GA69:84 
GA71:C9 
GA79:38 
GA81:26 
GA89:GF 
GA91:05 
GA99:72 
GAAL:E9 
GAA9:BD 
GAB1:F5 
GAB9:07 
GAC1:8C 
GAC9:16 
@AD1:95 
@AD9:17 
GAE1:89 
GAEQ:A4 
GAF1:14 
GAF9:A5 
@BG1:86 
@BG9:D1 
GB11:A4 
@B19:0C 
@B21:06 
@B29:19 
@B31:85 
9B39:8D 


48 
FB 
cé6 
co 
58 
AS 
F8 
BO 
88 
FO 
cé6 
4c 
EA 
E3 
85 
7c 
32 
Ag 
AD 
88 
3B 
EE 
3c 
97 
Ag 
FA 
7D 
12 
26 
17 
B3 
EG 
Ur) 
86 
83 
E6 
61 
76 
69 
68 
B9 
GE 
pc 
22 
8F 
oF 
F4 
49 
1E 
66 
6G 
Dl 
BG 
A5 
97 
A8 
68 
A2 
Ag 
OF 
62 
1F 
21 
F2 
G2 
66 
38 
AS 
8G 
3E 


Bl 
68 
FE 
97 
4c 
F7 
38 
G2 
91 
OA 
Ag 
16 
9D 
27 
42 
4c 
88 
38 
3A 
4c 
84 
EG 
6B 
56 
FF 
85 
94 
38 
76 
2a 
40 
cg 
63 
2B 
DG 
44 
E7 
cé6 
60 
6c 
G1 
GE 
85 
26 
95 
G1 
81 
CE 
DE 
6c 
85 
98 
3 
80 
a7 
66 
A6 
37 
36 
68 
42 
94 
A2 
69 
B8 
E6 
ES 
67 
DL 
g8 


0B41:86 
@B49:4C 
0B51:76 
@B59:48 
@B61:E6 
GB69:94 
@B71:EG 
@B79:DG 
@B81:A9 
GB89:AA 
@B91:C8 
@B99:A2 
GBA1: 86 
@BA9:85 
@BB1:88 
GBB9: 87 
G@BC1: 26 
@BC9:11 
@BD1: 06 
@BD9: 82 
@BE1:3C 
@BE9: 62 
@BF1:96 
GOBE9:05 
6CG1:40 
GCO9:CO 
GC11:62 
0C19:68 
GC21:AG 
6C29:86 
@C31:C6 
6039238 
0C41:62 
6C49:34 
GC51:B9 
9C59:90 
GC61:A9 
@C69:C2 
0C71:2F 
9C79:8D 
6C81:8A 
6c89:61 
9C91:28 
@C99:A5 
@CA1:F8 
GCA9:65 
@cB1:Cl 
@CB9:EG 
@CC1:AB 
6CC9:G2 
@CD1:F5 
@CD9:C2 
GCE1:6C 
@CE9:DG 
@CF1:4C 
GCF9:GF 
@DG1:65 
@DG9:41 
@D11:FO 
@D19:2A 
6D21:58 
@D29: 4E 
@D31:04 
@D39:F7 
@D41: 43 
@D49:C8 
@D51:87 
@D59:B8 
9D61:17 
9D69:58 


DO 


16 8C 
4A 25 
11 72 
2c A5 
2D 36 
68 92 
41 60 
FO AQ 
88 Fl 
A7 Ad 
DC 82 
DG E8 
GE 5E 
83 CD 
84 49 
B8 EG 
34 69 
98 73 
CSet7 
46 68 
19 85 
86 66 
A3 1A 
F3 OF 
AQ 1A 
3D 95 
32 2E 
FA 8D 
2E FO 
F7 6C 
DO EA 
4c 13 
38 4D 
2c 96 
05 68 
D1 OF 
7c 69 
33 48 
47 46 
OF B6 
9D 85 
76 9C 
1c AS 
2E FC 
A5 3F 
@2 62 
D8 C3 
D@ 15 
48 84 
9E DC 
84 40 
Ag 81 
89 7B 
88 G4 
27 52 
G1 93 
AS CO 
13 C8 
95 10 
71 2B 
2A C5 
57 Dl 
19 Bo 
4E 90 
14 91 
@5 A3 
@2 75 
GE 36 
12 12 
oo 14 


JUNE 1992 COMPUTE 


EG 
AC 
68 
2C 
71 
16 
14 
EO 
15 
Bl 
80 
FO 
85 
84 
85 
45 
94 
1A 
BO 
F8 
14 
El 
4c 
26 
BA 
Ci) 
AS 
1F 
12 
Ol 
5c 
U)) 
ce 
DA 
68 
2c 
61 
BE 
E8 
58 
46 
68 
40 
E2 
FO 
8E 
9D 
4c 
E6 
E8 
58 
ag 
cD 
60 
68 
83 
85 
14 
18 
AS 
38 
1D 
G2 
F8 
19 
36 
2E 
84 
26 
3c 


gc 
1A 
72 
ED 
c7 
83 
1l 
96 
8A 
@D 
33 
86 
83 
84 
83 
4E 
A6 
18 
41 
98 
OA 
19 
83 
8A 
A2 
7E 
8D 
6C 
3D 
62 
17 
18 
66 
6G 
5D 
85 
3c 
43 
a4 
31 
AT 
2A 
BE 
68 
ag 
E6 
23 
cé 
98 
69 
EF7 
32 
B9 
69 
cc 
53 
58 
cs 
62 
cs 
DA 
38 
1A 
96 
16 
@3 
60 
1D 
CE 
46 


48 
14 
F7 
9c 
E5 
AS 
AB 
DD 
A6 
78 
61 
BS. 
De 
36 
82 
5B 
16 
98 
FF 
8B 
CA 
9E 
FA 
El 
AC 
B9 
E9 
CA 
3F 
13 
yh) 
8B 
80 
F8 
4G 
76 
EC 
78 
AG 
G2 
2F 
A2 
El 
AC 
ahh 
66 
Dg 
11 
83 
82 
E9 
9D 
73 
43 
58 
7E 
7A 
19 
4E 
86 
EG 
AA 
El 
41 
FC 
60 
19 
Fl 
2E 
12 


G-35 


PROGRAMS 


@D71:92 
@D79:81 
@D81:3F 
@D89:85 
@D91:D5 
@D99:AF 
GDA1:6B 
ODA9:FO 
@DB1: 26 
@DB9:45 
@DC1:DG 
@DC9:72 
@DD1:61 
@DD9:3C 
@DE1:8¢6 
G@DE9:34 
@DF1:3A 
GODF9: 80 
GEG1:20 
GEG9:83 
@E11:6C 
GE19:E0 
GE21:86 
@E29:05 
@£31:43 
@E39:C2 
GE41:00 
GE49:61 
GE51:Al 
GE59:1C 
@E61:C5 
GE69:76 
@E71:41 
GE79:83 
GE81:8C 
GE89:7B 
GE91:8A 
@E99:4B 
@EA1:BD 
GEA9: 39 
@EB1:CE 
GEBY: 33 
@EC1:2A 
@EC9:5A 
GED1: 34 
GEDI: 60 
GEE1:33 
GEE9:8C 
GEF1:95 
OEF9:C7 
GFG1:02 
GFO9:E2 
GOF11:11 
GF19:49 
OF21:E0 
GF29:37 
@F31:9D 
GF39:84 
OF41:B5 
GF49:4C 
@F51:61 
GF59:60 
GOF61:F5 
GF69:52 
GF71:A6 
GF79:FG 
GF81:88 
GF89:25 
GF91:67 
GF99:61 


G-36 


94 
3F 
cc 
FD 
68 
85 
86 
2E 
co 
E2 
@D 
86 
@4 
6D 
9E 
7B 
FO 
1c 
ED 
51 
Da 
AQ 
AS 
77 
58 
@D 
79 
7A 
CA 
54 
14 
78 
2A 
43 
cs 
48 
96 
26 
Bl 
o4 
cD 
41 
36 
A3 
B8 
69 
cg 
ic 
45 
81 
86 
43 
41 
2F 
8D 
86 
2E 
8c 
Ol) 
OA 
37 
62 
4c 
83 
88 
EA 
97 
89 
89 
89 


COMPUTE 


E7 
Oo 
69 
7A 
82 
BA 
83 
3B 
FG 
80 
25 
36 
D8 
OF 
18 
GE 
4c 
88 
22 
09 
1c 
16 
B4 
B3 
62 
3F 
18 
DG 
FA 
21 
04 
4c 
3B 
17 
26 
66 
5c 
95 
67 
7D 
B4 
4c 
2B 
48 
B7 
36 
3c 
61 
EO 
91 
86 
E8 
32 
08 
88 
AE 
E2 
Ur) 
Ui) 
86 
68 
AE 
oo 
31 
69 
cs 
19 
89 
89 
89 


GE 
1E 
1c 
FF 
85 
66 
CA 
FO 
39 
51 
bg 
B3 
De 
19 
66 
05 
El 
4c 
Bo 
c3 
4c 
DB 
20 
91 
22 
84 
16 
E9 
66 
36 
E4 
62 
2B 
85 
58 
8E 
23 
07 
GF 
07 
19 
FA 
61 
20 
8E 
44 
BS 
ol 
06 
14 
Al 
78 
88 
cg 
AD 
6B 
EC 
47 
v3 
73 
6B 
35 
1l 
AS 
Ol 
Da 
60 
49 
96 
B7 


JUNE 1992 


86 
OF 
Ag 
61 
@D 
OF 
84 
5A 
A6 
AS 
72 
78 
Dg 
86 
9c 
cD 
c3 
86 
2B 
EG 
6B 
ce 
38 
98 
OF 
82 
c3 
68 
2A 
76 
FO 
61 
22 
AC 
9A 
39 
91 
5F 
04 
4c 
9c 
66 
66 
8B 
FF 
Da 
54 
F2 
66 
Fl 
22 
OA 
OF 
65 
AG 
58 
6B 
A2 
16 
89 
Oo 
GE 
Bo 
68 
16 
66 
6G 
59 
A2 
cD 


GFA1:DE 
@FA9:24 
@FB1:5D 
GFB9:87 
GFC1:7F 
GFC9:C4 
@FD1:42 
@FD9:6C 
@FE1:EO 
GFE9:00 
GFF1:6D 
GFF9:C8 
1001:D6 
1669:79 
10611:76 
1619:E8 
1621:2D 
1629385 
1631:81 
1639:4C 
1641:91 
1649:4E 
1051:4F 
1659:59 
1661:43 
1669:41 
1671:45 
1679:4D 
1681:E9 
1089:DC 
1691:86 
1999:52 
16A1:37 
16A9:4E 
16B1:45 
16B9:66 
16C1:41 
16C9:A2 
16D1:82 
16D9:8A 
1GE1:2F 
16E9:Cl 
1O6F1:A5 
16F9:82 
1161:11 
1169342 
1111:66 
1119:2A 
1121:D98 
1129:20 
1131:E6 
1139:38 
1141:34 
1149: 8B 
1151:22 
1159:@D 
1161:7F 
1169:3C 
1171:9E 
1179:8B 
1181:81 
1189:8B 
1191:Al 
1199:C5 
11A1:43 
11A9:88 
11B1:20 
11B9:86 
11C1:86 
11C9:A2 


EC 
36 
2c 
25 
c2 
68 
91 
61 
32 
@D 
2E 
D8 
55 
27 
46 
26 
4c 
41 
59 
47 
i) 
58 
28 
96 
06 
49 
45 
41 
48 
G2 
86 
84 
45 
54 
54 
4E 
26 
9A 
OA 
64 
D4 
49 
ce 
32 
A2 
46 
2A 
2B 
c7 
9E 
3A 
34 
13 
GOA 
AS 
1A 
33 
19 
36 
7E 
83 
8D 
B6 
c7 
88 
27 
32 
86 
AG 
G2 


62 
49 
F3 
c8 
57 
BG 
6B 
67 
2E 
oF 
12 
26 
56 
45 
4E 
93 
CE 
88 
27 
AB 
55 
57 
4P 
3c 
E5 
26 
A6 
13 
D8 
43 
49 
22 
49 
3c 
96 
26 
49 
Ag 
cl 
58 
Ag 
A5 
D3 
AS 
84 
2A 
FD 
24 
85 
99 
cé6 
17 
2D 
36 
c4 
89 
FF. 
36 
E3 
85 
86 
8F 
BB 
cl 
91 
co 
27 
86 
FC 
cé6 


16 
63 
28 
@D 
B6 
88 
48 
GE 
gc 
58 
5 
B3 
73 
33 
64 
68 
53 
FC 
6c 
39 
c2 
8a 
Go 
13 
8c 
42 
El 
41 
1) 
94 
4F 
2A 
45 
45 
49 
51 
4E 
85 
26 
68 
96 
61 
4c 
75 
A2 
51 
48 
2B 
53 
4c 
9B 
OA 
4c 
1) 
96 
38 
FO 
c8 
4c 
56 
88 
99 
c3 
CA 
53 
69 
CE 
AB 
84 
86 


AC 
32 
BC 
43 
5B 
FB 
79 
9B 
FC 
D4 
F7 
8B 
FE 
c7 
69 
57 
A7 
c2 
gc 
Fl 
8F 
6D 
oF 
Al 
ll 
D2 
D5 
B5 
43 
33 
63 
8A 
7E 
6E 
7E 
97 
D2 
3D 
12 
26 
1F 
BB 
BE 
49 
8F 
DS 
oF 
56 
6B 
18 
AE 
52 
33 
8D 
26 
95 
D4 
32 
85 
5c 
BA 
DB 
59 
c3 
1D 
1B 
22 
FC 
oD 
7F 


11D1:A6 
11D9:96 
11E1:8B 
11E9:04 
11F1:98 
11F9:68 
1201:F7 
1269:6D 
1211:aAC 
1219:86 
1221:C8 
1229:15 
1231:E8 
1239:GE 
1241:26 
1249: 46 
1251:62 
1259:34 
1261:FO 
1269:62 
1271:06 
1279:A4 
1281:31 
1289: 26 
1291:82 
1299:CB 
12A1:F2 
12A9:61 
12B1:64 
12B9:96 
12C1:33 
1209:82 
12D1:CF 
12D9:26 
12E1:15 
12E9:13 
12F1:6E 
12F9: 37 
1301:6D 
1369:E5 
1311:23 
1319:85 
1321:25 
1329:69 
1331:C9 
1339256 
1341314 
1349:EG 
1351:28 
1359:84 
1361: 6F 
1369: 68 
1371:90 
1379376 
1381:E4 
1389:A8 
1391:8D 
1399: 6C 
13A1:FO 
13A9:96 
13B1:19 
13B9:86 
13C1:26 
13C€9:99 
13D1:78 
13D9:AF 
13E1:49 
13E9:7E 
13F1:80 
13F9:59 


1411:29 
1419:25 
1421:86 
1429:71 


1479:E8 
1481:51 


Gl 
9A 


CA 
co 


14A9:C8 
14B1:D2 
14B9:74 
14C1:8F 
14€9:99 
14D1:A9 
14D9:9C 


14Fl: 
14F9:63 
1501:4C 
1509:BD 
1511:D6 
1519:29 
1521:89 
1529:09 
1531:04 


AA 
48 
08 
96 
96 
07 
12 
CE 
76 
4a 
23 
A6 
55 
Oo 
39 
7B 
6C 
16 


1561:19 
1569:39 
1571:C8 
1579344 


1589:E6 
1591:23 
1599:58 
15A1:A5 
15A9:FD 
15B1:D@ 
15B9: 48 
L5CUA1L2 
15C9:A4 
15D1:8A 
15D9: 6B 
15E1:CD 
15E9:CC 
15F1:93 
15F9:B9 
1661:B4 
1669:85 
1611:B4 
1619:FE 
1621:41 
1629:66 


1c 
54 
5c 


c4 
20 
85 
@D 
De 
4D 
14 
E3 
4c 
94 
15 
96 
68 
A4 
GE 
65 
85 
FF 
Fl 
8F 
GA 


1649:49 C8 13 21 AO AG AB GB ED 
1651:A5 14 AA 94 4C BD 92 C9 3C 
1659:80 98 66 26 A7 8F 4C 77 38 


16A9:1A AS 67 85 23 A4 3D 22 CD 
16B1:C9 30 D@ 21 AC 41 C5 1D GE 
16B9:DG 18 49 98 13 C8 Bl 87 2D 
16C1:14 A® FF C8 C4 1D F@ 18 41 


17061:C@ G8 G6 46 9E BC 18 GC AT 
1769:16 GC 2B @C 31 GC BB BB 43 
1711:0A G6 9E 32 30 36 31 9G F7 
1719:96 @6 C® FD DA BE D4 8D 85 
1721:0F 96 04 88 8D 12 D4 68 4A 


1771:02 D@ G1 68 B5 G3 39 G9 IE 
1779346 


1799:06 BB 13 7F Al 84 69 66 A5 
17A1:86 66 84 67 28 78 C4 AB ED 
17A9:CC 68 88 29 91 G6 AD 26 EF 
17B1:F4 98 A8 A7 A4 G8 2A GA B3 
17B9:69 5E 8A A6 E8 C8 DO F2 EE 
17C1:84 C@ 92 G3 E2 GA 78 GC 21 
17C9:61 G6 G8 1C 69 C9 A2 FF Al 
17D1:E8 36 EE 13 E4 69 FO GF CB 
17D9:C@® 26 7E DD 99 FG EF G1 C8 
17E1:7D BD 66 7F 85 68 35 F8 47 
17E9:G8 8D 14 95 63 AS 68 FO 47 
17F1:43 AD 6G 7E 95 G2 E4 OD 8G 
17F9:44 D2 62 CB 1@ 65 63 55 4D 
1801:51 38 EE 9C 15 86 C5 59 37 
1869:71 BB Fl @B 21 3E 85 5@ 2D 
1811:Al 93 96 OD F5 18 65 46 F4 
1819:47 65 3B 47 45 E6 93 C8 D7 
1821:48 56 GB B3 55 29 86 GA E5 
1829:86 59 1A 26 EG GG G4 G3 4A 
1831:6B 69 85 G5 16 64 88 19 DB 
1839:CE A2 OF 66 G2 26 G3 26 96 
1841:G0A 26 54 9C GB 49 98 BA OD 
1849:76 98 99 12 A5 GA E5 D4 G4 
1851:@A AS OB ES 93 3D GB E6 BI 
1859:28 @2 E6 G3 CA 18 D7 CB 32 


1861:96 
1869:36 
1871:05 
1879:11 
1881: 93 
1889:66 
1891:18 
1899:85 
18A1:EF 
18A9:37 
18B1:D1 
18B9:BO 
18C1:FO 
18C9:85 
18D1:63 
18D9: 60 
18E1:02 
18E9:98 
18F1:6F 
18F9:8A 
19061:96 
1969:9D 
1911:68 
1919:8C 
1921:63 
1929:62 
1931:F@ 
1939:0A 
1941320 
1949:B4 
1951:6B 
1959:1C 
1961:42 
1969:80 
1971:42 
1979:98 
1981:22 
1989: 6D 
1991:60 
1999:69 
19A1:5D 
19A9: 28 
19B1:DD 
19B9:4C 
19C1:28 
19C9:FO 
19D1:85 
19D9:FO 
19E1:B8 
19E9:20 
19F1:0D 
19F9:CO 
1AG1:908 
1A99:9D 
1A11:23 
1A19:16 
1A21:12 
1A29:11 
1A31:FO 
1A39:E8 
1A41:63 
1A49:76 
1A51:68 
1A59:54 
1A61:E4 
1A69:14 
1A71:6F 
1A79:4C 
1A81:67 
1A89:CC 


o5 
a8 
5B 
38 
65 
68 
63 
66 
98 
BG 
c8 
20 
96 
4c 
4 
a2 
19 
03 
3E 
E6 
cg 
B5 
26 
03 
02 
03 
32 
64 
rN 
7E 
E9 
oc 
2D 
05 
DG 
88 
FD 
DF 
04 
99 
84 
14 
74 
OB 
G1 
03 
96 
8D 
GA 
56 
06 
oD 
12 
c8 
GE 
07 
6E 
DD 
BD 
F3 
15 
42 
14 
14 
a8 
90 
OF 
2p 
AE 
62 


JUNE 1992 COMPUTE 


G3 


AE 


4a 


EC 
c3 
79 
0B 
cs 
Ag 
EG 
EA 
BO 
CE 
98 
ED 
A5 
17 
26 
(oh) 
77 
GE 
cg 
cg 
EQ 
61 
F2 
G2 
G2 
AS 
G1 
oF 
Al 
8D 
OB 
82 
3F 
A4 
46 
32 
63 
42 
A5 
gc 
3c 
A5 
CA 
85 
EO 
F4 
E4 
08 
12 
FF 
42 
6c 
FG 
86 
cs 
14) 
cg 
E4 
57 
14 
85 
1c 
E4 
37 
18 
62 
G4 
Ag 
FF 
22 


27 
G-37 


PROGRAMS 


1A91:28 
1A99:290 
1AA1:61 
1AA9:AG 
1AB1:20 
1AB9:C3 
1AC1:26 
1AC9:AC 
1ADL:A6 
1AD9:2D 
1AE1:97 
1AE9:A9 
1AF1:4C 
LAF9: 06 
1B61:53 
1B09:83 
1B11:6E 
1B19:6C 
1B21:9D 
1B29:81 
1B31:5D 
1B39:27 
1B41:53 
1B49:35 
1B51:85 
1B59: 46 
1B61:55 
1B69:A9 
1B71:AD 
1B79:77 
1B81:82 
1B89:0C 
1B91:64 
1B99:CD 
1BA1:D4 
1BA9:@1 
1BB1:13 
1BB9:99 
1BC1:62 
1BC9:63 
1BD1:9C 
1BD9: 33 
1BE1:C2 
1BE9:62 
1BF1:67 
1BF9:E2 
1C01:97 
1C09:8D 
1¢11:12 
1C€19:78 
1¢€21:6C 
1029:1F 
1C31:A9 
1€39:A9 
1¢41:18 
1€49:61 
1C51:A9 
1059:@3 
1C61:A9 
1€69:27 
1¢71:C9 
1079:4C 
1C81:D6 
1089: 60 
1C91:FG 
1099: 9B 
1CA1:96 
1CA9:56 
1CB1:86 
1CB9:4E 


G-38 


c3 
BA 
C4 
05 
D8 
6A 
Da 
33 
2B 
84 
A2 
Go 
59 
FF 
44 
64 
82 
De 
EC 
EE 
AC 
66 
14 
86 
38 
FO 
FO 
8c 
4c 
71 
6F 
DE 
BO 
45 
G2 
33 
4E 
21 
79 
8D 
20 
oD 
8D 
2D 
14 
03 
al 
14 
59 
AD 
Ag 
2D 
35 
08 
Bl 
27 
37 
Ag 
08 
GE 
c8 
BO 
FB 
Ag 
07 
68 
vat 
5D 
OB 
47 


61 
FF 
48 
AQ 
El 
B7 
26 
97 
A4 
2E 
DS 
26 
A6 
RE: 
AF 
co 
8D 
26 
CF 
12 
EC 
79 
26 
G2 
EB 
09 
1E 
8D 
4E 
59 
9B 
AD 
GE 
66 
42 
16 
19 
FF 
38 
OA 
91 
61 
83 
96 
4A 
91 
AQ 
97 
I) 
26 
42 
AD 
AG 
08 
65 
1B 
85 
9c 
8D 
E6 
Do 
9B 
68 
oD 
26 
29 
Ut) 
1l 
2c 
16 


COMPUTE JUNE 1992 


1CC1:42 
1CC9:3F 
1CD1:87 
1CD9: 62 
1CE1:2E 
1CE9:92 
1CF1:45 
1CF9: 43 
1D61:45 
1D69:45 
1D11:44 
1D19:4F 
1D21:54 
1D29:46 
1D31:4D 
1D39: OF 


85 
Go 
21 
DE 
11 
75 
53 
26 
76 
26 
41 
4D 
26 
41 
41 
64 


07 
12 
21 
52 
11 
9D 
46 
43 
46 
36 
54 
26 
49 
52 
44 
04 


26 
4c 
Ur) 
68 
12 
22 
2E 
co 
4F 
34 
45 
53 
49 
49 
@D 
EA 


48 
43 
57 
4F 
G6 
19 
41 
50 
26 
B8 
SF 
U1) 
42 
26 
9o 
EA 


oF 
4B 
45 
56 
DD 
3c 
53 
49 
54 
55 
46 
67 
59 
41 
76 
G6 


5D 
G1 
4c 
2E 
49 
26 
49 
4c 
48 
56 
52 
4E 
26 
48 
cl 
06 


D7 
c7 
)) 
4A 
1>}) 
7A 
93 
4A 
BB 
DB 
41 
27 
28 
23 
C6 
46 


Farid Ahmad programs his 64 in Is- 
lamabad, Pakistan. 


PAD DESIGN 


By Robert C. Marcus 

Impedance matching is an important con- 
cept in radio and electronics work. To get 
the maximum power from your ham radio 
to your antenna, for example, you'll have 
to match the impedance of your antenna 
to the impedance of your transmitter. 

If you want a filter to pass a desired 
band of frequencies, you'll have to make 
sure the input and output impedances of 
the filter match those of your input and out- 
put circuits. 

If you want to get the most power out 
of a stereo speaker, then the speaker im- 
pedance must match the output imped- 
ance of your amplifier. 

If you're a ham radio operator or an 
electronics hobbyist, these are just a few 
of the times when you might find it nec- 
essary to design an attenuator network, 
or what's generally referred to as a pad. 

Whether you want to insert additional 
attenuation or merely match impedanc- 
es, the math that's involved can be intim- 
idating. That's where Pad Design can 
help. It does all the number crunching 
necessary to calculate the resistive ele- 
ments necessary to meet the design re- 
quirements that you specify. 

The program is set up to deal with un- 
balanced T and Pi networks, but it can al- 
so deal with balanced H and O networks. 
The minimum-loss pad for impedance 
matching is included as well. 

In many applications, it's possible to 
use commercial standard-value resistors. 
Their low cost and availability are trade- 
offs for a slight compromise in the atten- 
uation and impedances being matched. 


The advantage of using Pad Design is 
that it lets you try out various standard val- 
ues to produce a network that is closest 
to the design criteria. 

Pad Design is written entirely in BA- 
SIC. To help avoid typing errors, enter it 
with The Automatic Proofreader. See “Typ- 
ing Aids” elsewhere in this section. 


Using the Program 

When the program is run, you can 
choose the type of network to be 
used: T, H, Pi, O, or MIN-LOSS. Pad De- 
sign then prompts for the input and out- 
put impedances that will be used, and 
if the network is a T/H or Pi/O, the in- 
sertion loss in decibels is asked for. 
The program then displays the network 
and gives the values required for the re- 
sistive arms. 

At this point you may select to end 
the program, return to the menu, or 
changes resistors to obtain the best 
choice of standard values. 

If you decide to make changes to 
the resistors, you'll be prompted for 
new values. The program limits the de- 
viation of value to plus or minus 20 per- 
cent of the actual design value; this is 
more than adequate when you are us- 
ing standard resistors whose values 
may vary by 10 percent. For more pre- 
cise values, 5- or 1-percent resistors 
would be items of choice. If the origi- 
nal design value is to be retained for a 
particular resistor, just press Return. 

After you make your changes, the 
network is displayed again. This time it 
lists two sets of impedances. The first 
gives the value of ZI, which results 
from the new R values when ZO termi- 
nates in the originally specified imped- 
ance. The second value gives ZO as it 
appears when ZI terminates in its spec- 
ified impedance. The insertion loss— 
calculated with the existing changes— 
is displayed as well. 


Balanced Networks 

When dealing with balanced networks, 
remember that the value of the series 
arm or arms is halved. Since the values 
given and entered are on a single-unit 
basis, you'll have to multiply by two 
when choosing standard values. 


Decimal Places 
The calculated values for resistors and 
impedances are rounded off at two dec- 


imal places for values below 1 ohm 
and one decimal place for values be- 
tween 1 and 1000 ohms. Attenuation 
values are rounded off at two decimal 
places. 

Should you wish to set your own val- 
ues for resistors and impedances, you 
can alter the multiplier. The multiplier is 
the function FNPM(x), which is defined 
in line 110. It is, in effect, powers of 10 
used with the INT() function to set the 
number of decimal places, such as 
INT(FNPM(n)*n+.5)/FNPM(n) where n 
is a floating point number. 

The function can be interpreted as 
FNPM(x)=104(BASE-(x<LL+(x>HL)). 

Base is the number of places that 
are to be rounded: 1 sets one decimal 
place, 2 sets two decimal places, and 
so on. LL is the lower limit. Below this 
value the number of places increases 
by one over the base number. HL is 
the high limit at which the number of 
places decreases by one from the 
base. 

To sum up our application, there’s 
one decimal place (base) between 1 
(LL) and 1000 (HL), there are two deci- 
mal places below 1, and there are no 
decimal places for 1000 and over. 

Programmers using this method for 
rounding off floating point numbers 
should note that making the base a 
negative number produces rounding to 
tenths, hundredths, and so on. 


PAD DESIGN 


BA 10 REM COPYRIGHT 1992 COMPU 

TE PUBLICATIONS INTL LTD 
- ALL RIGHTS RESERVED 
REM ***{2 SPACES}INITIA 
LIZE{2 SPACES}*** 
HDS="{RVS}{16 SPACES}PA 
D DESIGN{9 SPACES}":DEF 
FNPM (X) =107 (1~(X<1) +(X> 
1666)) 

cc$(1)="_ ":cC$(2)=" 
{CYN}RESULTS WITH NEW ' 
R' VALUES{7}" 
LO$(1)="INSERTION LOSS" 
:LO$ (2) ="MINIMUM-LOSS" 
ANS(1)="T OR H “:ANS(2 
="T OR O ":ANS$(3)="MIN- 
Loss" 
POKE783, PEEK (783) AND254 
: POKE53281,0: POKE53280, 
6 

REM ***{2 SPACES}MAIN M 
ENU{2 SPACES}*** 

PRINT" {CLR}"; :FORI=1T04 
@:PRINT"{RVS} ";:NEXT 


kQ 
PB 


166 


116 


CM 126 


DP 130 


FE 146 


DE 156 


JE 160 


AC 176 


GH 


HM 


DA 


1890 


196 


266 


216 


226 
236 


246 


2568 


268 
276 


286 
296 
306 
316 
326 
336 
346 


358 
360 
376 


386 
396 


406 


416 
426 
436 
446 
456 
466 


476 


486 


496 
568 
518 


PRINT" {HOME} "TAB (5) HDS 
RO=3:CO=5:GOSUB115@: PRI 
NT" SELECT: ":CO=18:FORI= 
1703 
RO=RO+2:GOSUB115@: PRINT 
I" — "ANS$(I) :NEXT 
INPUT" {DOWN}CHOICE:";P$ 
2: IFPS<"1L"ORPS>"3"THEN21 
(] 
PH=1 
INPUT" {DOWN}ENTER INPUT 
{2 SPACES} IMPEDANCE"; ZI 
:IFZI=6 THENGOSUB1260:G 
070239 
INPUT"ENTER OUTPUT IMPE 
DANCE"; ZO: IFZO=GTHENGOS 
UB1260:GOTO24G 
IFP$="3"ANDZO=ZITHENPRI 
NT" {DOWN} {RVS}MIN-LOSS 
{SPACE}IS TO MATCH Z'S" 
:GOTO1219 
IFPS="3"THEN3GG 
INPUT"ENTER ATTENUATION 
IN DB.";AT 
IFAT=@THEN1259 
N=EXP (LOG (1G) *AT/18) 
ONVAL (P$) GOTO310,449,57 
G 
REM ***{2 SPACES}CALC F 
OR T OR H{3 SPACES}*** 
R3=2*SQR(ZI*ZO*N) /(N-1) 
R1=Z1* (N+1) /(N-1) -R3:R1 
=INT (FNPM(R1) *R1+.5) /EN 
PM(R1) 
R2=ZO* (N+1) /(N-1) -R3:R2 
=INT (FNPM(R2) *R2+.5) /EN 
PM(R2) 
R3=INT (FNPM(R3) *R3+.5)/ 
FNPM(R3) 
IFSGN (R2) =-1THEN1230 
RA=R1:RB=R2:RC=R3 
GOTO69G 
ZA= (ZO+R2) *R3/(ZO+R2+R3 
)+R1:ZA=INT (ENPM(ZA)*ZA 
+.5) /FNPM (ZA) 
ZB=(ZI+R1)*R3/(ZI+R1+R3 
)+R2:ZB=INT (FNPM(ZB) *ZB 
+.5) /FNPM(ZB) 
VL=1/( (ZO0+R2) *R3/((ZO+R 
2+R3) *ZA) *Z0/(ZO+R2) ) 
AT=INT (100* (20*LOG (VL) / 
LOG (10) -18*LOG (ZA/ZO) /L 
0G(16))+.5)/186 
GOTO69G 
REM ***{2 SPACES}CALC F 
OR ' OR O{3 SPACES}*** 
R3=(N-1) /2*SQR(ZI*Z0/N) 
R1L=1/(1/Z1* (N+1) /(N-1) - 
(1/R3) ) :R1=INT (FNPM(R1) 
*R1+.5) /ENPM(R1L 
R2=1/(1/2Z0* (N+1) / (N-1) - 
(1/R3) ) :R2=INT (FNPM(R2) 
*R2+.5) /ENPM(R2 
R3=INT (FNPM(R3) *R3+.5)/ 
FNPM(R3) 
IFSGN (R1) =-1THEN1239 
RA=R1:RB=R2:RC=R3 
GOTO878 


XX 


XP 


DM 


BD 


MX 
xd 


XR 
MA 
HD 


MK 
sQ 


PF 


MR 


ME 


HP 


KP 


Gs 


XJ 


SM 


526 


536 


546 


550 


560 
576 
580 
596 


666 


619 
620 
630 
640 


656 


660 
676 


686 
6995 


768 


716 
728 


736 


746 


758 


766 


776 


788 


7196 


869 


0Z=ZO*R2/(Z0+R2) :1Z=Z1* 
R1/(ZI+R1) 

ZA=(OZ+R3) *R1/(0Z+R1+R3 
) :ZA=INT (FNPM(ZA)*ZA+.5 
) /ENPM (ZA) 

ZB=(1Z+R3) *R2/(1Z+R2+R3 
) :ZB=INT (FNPM(ZB) *ZB+.5 
) /ENPM (ZB) 

AT=INT (168* (20*LOG ( (02+ 
R3) /0Z) /LOG (10) -18*L0G ( 
ZA/ZO) /LOG (16))+.5) /108 
GOTO876 

REM ***{2 SPACES}CALC F 
OR MIN-LOSS{2 SPACES}** 
* 
IFZO>ZITHENZ=Z1:Z1=Z0:Z 
O=Z 
R3=Z0/SQR(1-(Z0/ZI)) :R3 
=INT (FNPM(R3) *R3+.5) /EN 
PM(R3) 
R1=ZI*SQR(1-(ZO/Z1)) :R1 
=INT (FNPM(R1)*R1+.5) /EN 
PM(R1) 

ZA=Z1 

RA=R1: RB=R2:RC=R3 
GOTO66G 
ZA=Z0*R3/(ZO+R3) +R1:ZA= 
INT (ENPM(ZA) *ZA+.5) /ENP 
M(ZA) 

ZB= (ZI+R1) *R3/(ZI+R1+R3 
) :ZB=INT (FNPM(ZB)*ZB+.5 
) /ENPM (ZB) 

VL=ZA/ (ZO*R3/(ZO+R3) ) 
AT=INT (166% (26*LOG (VL) / 
LOG (18) -18*LOG (ZA/Z0) /L 
0G(1G))+.5)/106 
GOTO198¢ 

REM ***{2 SPACES}DISPLA 
Y T NETWORK{2 SPACES}** 
* 

PRINT" {CLR}"HD$" 

{2 SPACES}"ANS$ (1) 
PRINTTAB (5) CCS (PH) 
PRINTTAB (49) "CCCC{RVS} 
{WHT}{3 SPACES}{7}{OFF} 
CC{R}CC{RVS} {WHT} 

{3 SPACES}{7}{OFF}CCC" 
PRINTTAB(16)"{8 SPACES} 
B"™ 

PRINTTAB(18)"{3 SPACES} 
R1{3 SPACES}{RVS} {WHT} 
{SPACE}{7}{OFF} 

{4 SPACFS}R2" 
PRINTTAB(16)"{8 SPACES} 
*{RVS} {WHT} {7}{OFF} R3" 
PRINTTAB(16)"{8 SPACES} 
{RVS}{WHT} {7}{OFF}" 
PRINTTAB(10)"{3 SPACES} 
{WHT}{3 @}{7}{2 SPACES} 
B{2 SPACES}{WHT}{3 @} 
738 é 
PRINTTAB (9) "CCCCCCCCC 
{E}CECECECC"ig: 
PRINTTAB(10)"{3 SPACES} 
{WHT} {T}7{T}{7} 

{5 SPACES} {WHT}{T}]{T} 
47)" 

PRINT"{3 NOWN}T NOTE: I 


JUNE 1992 COMPUTE G-39 


PROGRAMS 


BX 


AG 


MD 


sD 
MK 


lens 


CF 
sD 


AC 
Qc 


PJ 


MH 


RG 


ES 


G-40 


810 
829 


830 


840 


850 


860 
876 


880 


898 


908 


9190 


920 


936 


949 


956 


966 
976 


989 


990 
1668 


1616 
1626 
1636 


1646 


1856 


1668 


F BALANCED H THEN Rl & 
{SPACE}R2" 

PRINT"{8 SPACES}ARE HAL 
VED." 

PRINT" {DOWN}R1="R1TAB (1 
5) "R2="R2TAB (3G) "R3="R3 
RO=5:CO=3:GOSUB1159:IFP 
H=1THENPRINT"ZI"ZITAB (3 
6) "z0"Z0:GOTO856 
PRINT"ZI{CYN}"ZATAB (38) 
"£7}2Z0"Z0: RO=7:GOSUB115 
@:PRINT"{2 SPACES}"ZITA 
B(36)"{2 SPACES} {CYN}"Z 
B"{7}" 
RO=11:CO=16:GOSUB1156:P 
RINTLOS (INT (VAL(P$) /2+. 
5));aT" DB" 

GOTO1166 

REM ***{2 SPACES}DISPLA 
Y { NETWORK{2 SPACES}** 
* 


PRINT" {CLR}"HDS$" 
{2 SPACES}"AN$ (2) 
PRINTTAB (5) CCS (PH) 
PRINTTAB (56) "CCCCC{R}CC 
{RVS}{WHT}{3 SPACES} 
{OFF}{7}CC{R}CCCC" 
PRINTTAB(16)"{5 SPACES} 
B{7 SPACES}B" 
PRINTTAB(16)"{5 SPACES} 
{RVS}{WHT} {OFF}{7} 
{3 SPACES}R3{2 SPACES} 
{RVS} {WHT} {OFF}{7}" 
PRINTTAB(16)"{5 SPACES} 
{RVS}{WHT} {OFF}{7} R1 
{4 SPACES}{RVS} {WHT} 
{OFF}{7} R2" 
PRINTTAB(16)"{5 SPACES} 
{RVS}{WHT} {OFF}{7}> 
{7 SPACES}{RVS} {WHT} 
{OFF} {7}" 
PRINTTAB(10)"{5 SPACES} 
B{2 SPACES} {WHT}{3 @} 
€7}{2 SPACES}B" 
PRINTTAB (18) "CCCCC{E}CC 
ccccc{E}Ccccc" % 
PRINTTAB(10)"{8 SPACES} 
{WHT} {T}7{TH{7}" 
PRINT"{3 DOWN} NOTE: I 
F BALANCED O THEN R3 IS 
HALVED" 
GOTO820 
REM ***{2 SPACES}DISPL 
AY MIN-LOSS{2 SPACES}* 
ak 


PRINT" {CLR}"HDS" 

{2 SPACES}"ANS (3) 
PRINTTAB (5) CC$ (PH) 
PRINTTAB (49) "CCCC{RVS} 
{WHT}{3 SPACES}{7} 
{OFF }CC{R}CCCCCCCC" 
PRINTTAB (10) " 

{8 SPACES}B" 

PRINTTAB (10) " 

{3 SPACES}R1{3 SPACES} 
{RVS} {WHT} {7}{OFF}" 
PRINTTAB (10) " 

{8 SPACES}{RVS} {WHT} 


COMPUTE JUNE 1992 


FS 


FJ 


Qs 
cD 


BM 
SD 
KE 


KS 
PQ 


SH 


CK 
RM 
XR 
AJ 


AA 


KH 


AD 


MK 


RR 


JK 


HP 


MP 


RK 


CR 


DK 


1076 


1686 


1098 


1106 


1116 


1126 


1136 


1146 
1156 


1166 


1176 


11806 


1196 


1266 


1216 


1226 


1236 


1246 


1256 


12668 


1276 


1286 


1296 


1368 


1318 


{7}{OFF} R3" 
PRINTTAB(19)" 
{8 SPACES}{RVS} {WHT} 
£7}{OFF}" 
PRINTTAB(19)" 
{3 SPACES}{WHT}{3 @} 
¢73{2 SPACES}B" 
PRINTTAB (9) "CCCCCCCCC 
{E}CCCCCCCcc" 
PRINTTAB (10) " 
{3 SPACES} {WHT} {T}]{T} 
<7" 
PRINT"{3 DOWN} NOTE: 
{SPACE}IF BALANCED THE 
N Rl IS HALVED." 
PRINT" {DOWN} R1="RLTAB ( 
30) "R3="R3 
GOT083G 
REM *** SUB-RTES *** 
POKE781,RO: POKE782,CO: 
SYS65520: RETURN 
RO=22:CO=G:GOSUB1156:P 
RINT" {CYN}1-ENTER NEW 
{SPACE}R VALUES 
{4 SPACES}2-MENU 
{4 SPACES}3-QUIT{7}" 
GETA$: IFAS<>"1"ANDAS<> 
"2"ANDAS<>"3"THEN1176 
IFAS="2"THENL6G 
IFAS="3"THENPRINT" 
{CLR}": POKE53281,6:POK 
E£53280,14:END 
PRINT" {CLR}":GOSUB1276 
: ONVAL (P$)GOTO396,520, 
640 
PRINT" {DOWN} {CYN}HIT S 
HIFT TO REDO{7}":WAIT6 
53,1:GOTO16G 
PRINT"{RVS}VALUE ENTER 
ED IS > OR < THAN 20% 
{SPACE}OF":PRINTTAB (10 
) Rt RETURN 
PRINT" {DOWN} {RVS}THE I 
NSERTION LOSS IS < MIN 
-Loss -" 
PRINT"{5 SPACES}{RVS}R 
EDO OR CHOOSE MIN.LOSS 
":GOTO1210 
PRINT" {DOWN}{RVS} SOME 
INSERTION LOSS MUST E 
XIST ":GOTO1216 
PRINT" {DOWN}{RVS} SOME 
IMPEDANCE MUST EXIST 
{SPACE}":RETURN 
REM *** GET NEW R VALU 
ES eae 
RO=4:CO=5:GOSUB1150:PR 
INT" {CYN} {RVS}RETURN 
{OFF} ONLY FOR ORIGINA 
L R VALUE{7}{DOWN}" 
PH=2:R1S="":R2Ss" 
=" 
INPUT"ENTER NEW Rl VAL 
UE";R1$:R1=VAL (R1$) : IF 
R1$=""THENR1=RA:GOTO13 
20 
IFABS (VAL (R1$) -RA)>.2* 
RATHENR=RA:R1S="":GOSU 


R3$ 


KG 
CA 


SG 


ss 


XA 


JR 


JG 1386 


B1220:GOT01306 
IFPS="3"THEN1350 
INPUT"ENTER NEW R2 VAL 
UE"; R2$:R2=VAL (R2$) :1F 
R2$=""THENR2=RB:GOTO13 
50 

IFABS (VAL (R2$)-RB) >. 2* 
RBTHENR=RB: R2$="":GOSU 
B1220:GOTO1330 
INPUT"ENTER NEW R3 VAL 
UE"; R3$:R3=VAL(R3S) :1F 
R3S="""THENR3=RC:GOTO13 
70 

IFABS (VAL(R3$) -RC) >.2* 
RCTHENR=RC: R3$="":GOSU 
B122:GOTO1350 
IFR1=RAANDR2=RBANDR3=R 
CTHENPH=1 

RETURN 


1326 
1336 


1346 


1356 


1366 


1376 


Robert C. Marcus lives in St. Thomas, 
Ontario, Canada. He's the author of 
CoilCalc (June 1991). 0 


TYPING AIDS 


MLX, our machine language en- 
try program for the 64 and 128, 
and The Automatic Proofreader 
are utilities that help you type in 
Gazette programs without mak- 
ing mistakes. To make room for 
more programs, we no longer in- 
clude these labor-saving utili- 
ties in every issue, but they can 
be found on each Gazette 
Disk and are printed in all is- 
sues of Gazette through June 
1990 

If you don’t have access to 
a back issue or to one of our 
disks, write to us, and we'll 
send you free copies of both of 
these handy programs. We'll 
also include instructions on 
how to type in Gazette pro- 
grams. Please enclose a self- 
addressed, stamped envelope. 
Write to Typing Aids, COM- 
PUTE’s Gazette, 324 West Wen- 
dover Avenue, Suite 200 
Greensboro, North Carolina 
27408